comparison scripts/plot/private/__ezplot__.m @ 14214:2fe0f5fa8cc3

Replace to-be-deprecated findstr occurrences with strfind. * help.m, textread.m, textscan.m, pkg.m, legend.m, __ezplot__.m, __go_draw_axes__.m, rundemos.m: Replace to-be-deprecated findstr occurrences with strfind.
author Rik <octave@nomad.inbox5.com>
date Wed, 18 Jan 2012 21:15:42 -0800
parents 72c96de7a403
children 5d3a684236b0
comparison
equal deleted inserted replaced
14213:a022c04f68cc 14214:2fe0f5fa8cc3
115 xarg = argnames(fun)(1); 115 xarg = argnames(fun)(1);
116 yarg = argnames(fun)(2); 116 yarg = argnames(fun)(2);
117 endif 117 endif
118 elseif (isa (fun, "function_handle")) 118 elseif (isa (fun, "function_handle"))
119 fstr = func2str (fun); 119 fstr = func2str (fun);
120 if (length (findstr (fstr, ")")) != 0) 120 if (! isempty (strfind (fstr, ')')))
121 args = regexp (substr (fstr, 3, findstr (fstr, ")")(1) - 3), 121 args = regexp (substr (fstr, 3, strfind (fstr, ')')(1) - 3),
122 '(\w+)', 'tokens'); 122 '(\w+)', 'tokens');
123 fstr = substr (fstr, findstr (fstr, ")")(1) + 1); 123 fstr = substr (fstr, strfind (fstr, ')')(1) + 1);
124 else 124 else
125 args = {{"x"}}; 125 args = {{"x"}};
126 endif 126 endif
127 if (isplot && length (args) == 2) 127 if (isplot && length (args) == 2)
128 nargs = 2; 128 nargs = 2;
173 funy = vectorize (funy); 173 funy = vectorize (funy);
174 fstry = formula (funy); 174 fstry = formula (funy);
175 elseif (isa (funy, "function_handle")) 175 elseif (isa (funy, "function_handle"))
176 parametric = true; 176 parametric = true;
177 fstry = func2str (funy); 177 fstry = func2str (funy);
178 if (length (findstr (fstry, ")")) != 0) 178 if (! isempty (strfind (fstry, ')')))
179 args = regexp (substr (fstry, 3, findstr (fstry, ")")(1) - 3), 179 args = regexp (substr (fstry, 3, strfind (fstry, ')')(1) - 3),
180 '(\w+)', 'tokens'); 180 '(\w+)', 'tokens');
181 fstry = substr (fstry, findstr (fstry, ")")(1) + 1); 181 fstry = substr (fstry, strfind (fstry, ')')(1) + 1);
182 else 182 else
183 args = {{"y"}}; 183 args = {{"y"}};
184 endif 184 endif
185 if (length (args) != nargs) 185 if (length (args) != nargs)
186 error ("%s: excepting a function of %d arguments", func, nargs); 186 error ("%s: excepting a function of %d arguments", func, nargs);
214 endif 214 endif
215 funz = vectorize (funz); 215 funz = vectorize (funz);
216 fstrz = formula (funz); 216 fstrz = formula (funz);
217 elseif (isa (funz, "function_handle")) 217 elseif (isa (funz, "function_handle"))
218 fstrz = func2str (funz); 218 fstrz = func2str (funz);
219 args = regexp (substr (fstrz, 3, findstr (fstrz, ")")(1) - 3), 219 args = regexp (substr (fstrz, 3, strfind (fstrz, ')')(1) - 3),
220 '(\w+)', 'tokens'); 220 '(\w+)', 'tokens');
221 if (length (args) != nargs) 221 if (length (args) != nargs)
222 error ("%s: excepting a function of %d arguments", func, nargs); 222 error ("%s: excepting a function of %d arguments", func, nargs);
223 endif 223 endif
224 fstrz = substr (fstrz, findstr (fstrz, ")")(1) + 1); 224 fstrz = substr (fstrz, strfind (fstrz, ')')(1) + 1);
225 else 225 else
226 error ("%s: parametric plots expect 3 functions", func); 226 error ("%s: parametric plots expect 3 functions", func);
227 endif 227 endif
228 endif 228 endif
229 endif 229 endif