Mercurial > hg > octave-lyh
comparison scripts/plot/__plt2ss__.m @ 5115:57372235194b
[project @ 2005-01-24 18:38:45 by jwe]
author | jwe |
---|---|
date | Mon, 24 Jan 2005 18:38:45 +0000 |
parents | 17826ec287bc |
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} {} __plt2ss__ (@var{x}, @var{y}, @var{fmt}) | 21 ## @deftypefn {Function File} {[data, fmtstr] =} __plt2ss__ (@var{x}, @var{y}, @var{fmt}) |
22 ## @end deftypefn | 22 ## @end deftypefn |
23 | 23 |
24 ## Author: jwe | 24 ## Author: jwe |
25 | 25 |
26 function __plt2ss__ (x, y, fmt) | 26 function [data, fmtstr] = __plt2ss__ (x, y, fmt) |
27 | 27 |
28 if (nargin < 2 || nargin > 3) | 28 if (nargin < 2 || nargin > 3 || nargout != 2) |
29 msg = sprintf ("__plt2ss__ (x, y)"); | 29 usage ("[data, fmtstr] = __plt2ss__ (x, y, fmt)"); |
30 msg = sprintf ("%s __plt2ss__ (x, y, fmt)", msg); | |
31 usage (msg); | |
32 elseif (nargin == 2) | 30 elseif (nargin == 2) |
33 fmt = ""; | 31 fmt = ""; |
34 elseif (rows (fmt) > 1) | 32 elseif (rows (fmt) > 1) |
35 fmt = fmt (1, :); | 33 fmt = fmt (1, :); |
36 endif | 34 endif |
38 [x_nr, x_nc] = size (x); | 36 [x_nr, x_nc] = size (x); |
39 [y_nr, y_nc] = size (y); | 37 [y_nr, y_nc] = size (y); |
40 | 38 |
41 if (x_nr == 1 && x_nr == y_nr && x_nc == 1 && x_nc == y_nc) | 39 if (x_nr == 1 && x_nr == y_nr && x_nc == 1 && x_nc == y_nc) |
42 tmp = [x, y]; | 40 tmp = [x, y]; |
43 cmd = sprintf ("gplot tmp %s", fmt); | 41 data = tmp; |
44 eval (cmd); | 42 fmtstr = fmt; |
45 else | 43 else |
46 error ("__plt2ss__: arguments must be scalars"); | 44 error ("__plt2ss__: arguments must be scalars"); |
47 endif | 45 endif |
48 | 46 |
49 endfunction | 47 endfunction |