comparison scripts/plot/__plt2__.m @ 5115:57372235194b

[project @ 2005-01-24 18:38:45 by jwe]
author jwe
date Mon, 24 Jan 2005 18:38:45 +0000
parents 22bd65326ec1
children 4c8a2e4e0717
comparison
equal deleted inserted replaced
5114:cda8c0a823c5 5115:57372235194b
16 ## along with Octave; see the file COPYING. If not, write to the Free 16 ## along with Octave; see the file COPYING. If not, write to the Free
17 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 17 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
18 ## 02111-1307, USA. 18 ## 02111-1307, USA.
19 19
20 ## -*- texinfo -*- 20 ## -*- texinfo -*-
21 ## @deftypefn {Function File} {} __plt2__ (@var{x1}, @var{x2}, @var{fmt}) 21 ## @deftypefn {Function File} {[data, fmtstr] =} __plt2__ (@var{x1}, @var{x2}, @var{fmt})
22 ## @end deftypefn 22 ## @end deftypefn
23 23
24 ## Author: jwe 24 ## Author: jwe
25 25
26 function __plt2__ (x1, x2, fmt) 26 function [data, fmtstr] = __plt2__ (x1, x2, fmt)
27 27
28 if (nargin < 2 || nargin > 3) 28 if (nargin < 2 || nargin > 3 || nargout != 2)
29 usage ("__plt2__ (x1, x2, fmt)"); 29 usage ("[data, fmtstr] = __plt2__ (x1, x2, fmt)");
30 endif 30 endif
31 31
32 if (nargin == 2) 32 if (nargin == 2)
33 fmt = ""; 33 fmt = "";
34 endif 34 endif
38 endif 38 endif
39 39
40 if (any (any (imag (x1)))) 40 if (any (any (imag (x1))))
41 x1 = real (x1); 41 x1 = real (x1);
42 endif 42 endif
43
43 if (any (any (imag (x2)))) 44 if (any (any (imag (x2))))
44 x2 = real (x2); 45 x2 = real (x2);
45 endif 46 endif
47
46 if (isscalar (x1)) 48 if (isscalar (x1))
47 if (isscalar (x2)) 49 if (isscalar (x2))
48 __plt2ss__ (x1, x2, fmt); 50 [data, fmtstr] = __plt2ss__ (x1, x2, fmt);
51 else
52 error ("__plt2__: invalid data for plotting");
49 endif 53 endif
50 elseif (isvector (x1)) 54 elseif (isvector (x1))
51 if (isvector (x2)) 55 if (isvector (x2))
52 __plt2vv__ (x1, x2, fmt); 56 [data, fmtstr] = __plt2vv__ (x1, x2, fmt);
53 elseif (ismatrix (x2)) 57 elseif (ismatrix (x2))
54 __plt2vm__ (x1, x2, fmt); 58 [data, fmtstr] = __plt2vm__ (x1, x2, fmt);
59 else
60 error ("__plt2__: invalid data for plotting");
55 endif 61 endif
56 elseif (ismatrix (x1)) 62 elseif (ismatrix (x1))
57 if (isvector (x2)) 63 if (isvector (x2))
58 __plt2mv__ (x1, x2, fmt); 64 [data, fmtstr] = __plt2mv__ (x1, x2, fmt);
59 elseif (ismatrix (x2)) 65 elseif (ismatrix (x2))
60 __plt2mm__ (x1, x2, fmt); 66 [data, fmtstr] = __plt2mm__ (x1, x2, fmt);
67 else
68 error ("__plt2__: invalid data for plotting");
61 endif 69 endif
70 else
71 error ("__plt2__: invalid data for plotting");
62 endif 72 endif
63 73
64 endfunction 74 endfunction