comparison scripts/plot/__pltopt__.m @ 6264:cc2bee854d23

[project @ 2007-02-01 10:00:05 by jwe]
author jwe
date Thu, 01 Feb 2007 10:00:05 +0000
parents 1a6d826e92b5
children 0078497b3b0b
comparison
equal deleted inserted replaced
6263:d60127449a29 6264:cc2bee854d23
106 ## @seealso{__pltopt1__} 106 ## @seealso{__pltopt1__}
107 ## @end deftypefn 107 ## @end deftypefn
108 108
109 ## Author: jwe 109 ## Author: jwe
110 110
111 function [fmt, keystr] = __pltopt__ (caller, opt) 111 function options = __pltopt__ (caller, opt)
112 112
113 if (nargin == 2 && nargout == 2) 113 if (nargin == 2 && nargout == 1)
114 if (ischar (opt)) 114 if (ischar (opt))
115 nel = rows (opt); 115 nel = rows (opt);
116 elseif (iscellstr (opt)) 116 elseif (iscellstr (opt))
117 nel = numel (opt); 117 nel = numel (opt);
118 else 118 else
119 error ("__pltopt__: expecting argument to be character string or cell array of character strings"); 119 error ("__pltopt__: expecting argument to be character string or cell array of character strings");
120 endif 120 endif
121 fmt = cell (nel, 1);
122 keystr = cell (nel, 1);
123 if (ischar (opt)) 121 if (ischar (opt))
124 opt = cellstr (opt); 122 opt = cellstr (opt);
125 endif 123 endif
126 for i = 1:nel 124 for i = nel:-1:1
127 [tfmt, tkey] = __pltopt1__ (caller, opt{i}); 125 options(i) = __pltopt1__ (caller, opt{i});
128 fmt{i} = tfmt;
129 keystr{i} = tkey;
130 endfor 126 endfor
131 else 127 else
132 print_usage (); 128 print_usage ();
133 endif 129 endif
134 130