2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
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 |
|
7 ## the Free Software Foundation; either version 2, or (at your option) |
|
8 ## any later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License 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, 59 Temple Place - Suite 330, Boston, MA |
|
18 ## 02111-1307, USA. |
933
|
19 |
3449
|
20 ## -*- texinfo -*- |
|
21 ## @deftypefn {Function File} {} __plt2__ (@var{x1}, @var{x2}, @var{fmt}) |
|
22 ## @end deftypefn |
3402
|
23 |
2314
|
24 ## Author: jwe |
|
25 |
2315
|
26 function __plt2__ (x1, x2, fmt) |
933
|
27 |
|
28 if (nargin < 2 || nargin > 3) |
2315
|
29 usage ("__plt2__ (x1, x2, fmt)"); |
933
|
30 endif |
|
31 |
|
32 if (nargin == 2) |
|
33 fmt = ""; |
|
34 endif |
|
35 |
|
36 if (! isstr (fmt)) |
2315
|
37 error ("__plt2__: fmt must be a string"); |
933
|
38 endif |
|
39 |
|
40 if (any (any (imag (x1)))) |
|
41 x1 = real (x1); |
|
42 endif |
|
43 if (any (any (imag (x2)))) |
|
44 x2 = real (x2); |
|
45 endif |
4030
|
46 if (isscalar (x1)) |
|
47 if (isscalar (x2)) |
2315
|
48 __plt2ss__ (x1, x2, fmt); |
933
|
49 endif |
4030
|
50 elseif (isvector (x1)) |
|
51 if (isvector (x2)) |
2315
|
52 __plt2vv__ (x1, x2, fmt); |
4030
|
53 elseif (ismatrix (x2)) |
2315
|
54 __plt2vm__ (x1, x2, fmt); |
933
|
55 endif |
4030
|
56 elseif (ismatrix (x1)) |
|
57 if (isvector (x2)) |
2315
|
58 __plt2mv__ (x1, x2, fmt); |
4030
|
59 elseif (ismatrix (x2)) |
2315
|
60 __plt2mm__ (x1, x2, fmt); |
933
|
61 endif |
|
62 endif |
|
63 |
|
64 endfunction |