904
|
1 # Copyright (C) 1993, 1994 John W. Eaton |
245
|
2 # |
|
3 # This file is part of Octave. |
|
4 # |
|
5 # Octave is free software; you can redistribute it and/or modify it |
|
6 # under the terms of the GNU General Public License as published by the |
|
7 # Free Software Foundation; either version 2, or (at your option) any |
|
8 # later version. |
|
9 # |
|
10 # Octave is distributed in the hope that it will be useful, but WITHOUT |
|
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 # for more details. |
|
14 # |
|
15 # You should have received a copy of the GNU General Public License |
|
16 # along with Octave; see the file COPYING. If not, write to the Free |
|
17 # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
18 |
934
|
19 function plot_2_v_v (x, y, fmt) |
4
|
20 |
934
|
21 if (nargin < 2 || nargin > 3) |
|
22 msg = sprintf ("plot_2_v_v (x, y)\n"); |
|
23 msg = sprintf ("%s plot_2_v_v (x, y, fmt)", msg); |
|
24 usage (msg); |
|
25 elseif (nargin == 2) |
|
26 fmt = ""; |
4
|
27 endif |
|
28 |
|
29 [x_nr, x_nc] = size (x); |
|
30 [y_nr, y_nc] = size (y); |
|
31 |
|
32 if (x_nr == 1) |
|
33 x = x'; |
|
34 tmp = x_nr; |
|
35 x_nr = x_nc; |
|
36 x_nc = tmp; |
|
37 endif |
|
38 |
|
39 if (y_nr == 1) |
|
40 y = y'; |
|
41 tmp = y_nr; |
|
42 y_nr = y_nc; |
|
43 y_nc = tmp; |
|
44 endif |
|
45 |
|
46 if (x_nr != y_nr) |
|
47 error ("plot_2_v_v: vector lengths must match"); |
|
48 endif |
|
49 |
|
50 tmp = [x, y]; |
934
|
51 cmd = sprintf ("gplot tmp %s", fmt); |
|
52 eval (cmd); |
4
|
53 |
|
54 endfunction |