Mercurial > hg > octave-nkf
changeset 5443:ec8c33dcd1bf
[project @ 2005-09-08 01:40:57 by jwe]
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,47 @@ +2005-09-07 Bill Denney <denney@seas.upenn.edu> + + * audio/playaudio.m, control/base/__bodquist__.m, + control/base/lqg.m, control/obsolete/dezero.m, + control/system/__syschnamesl__.m, control/system/__sysconcat__.m, + control/system/c2d.m, control/system/cellidx.m, + control/system/d2c.m, control/system/dmr2d.m, + control/system/is_signal_list.m, control/system/listidx.m, + control/system/ss.m, control/system/sysappend.m, + control/system/sysconnect.m, control/system/sysdup.m, + control/system/sysgetsignals.m, control/system/sysidx.m, + control/system/sysprune.m, control/system/syssetsignals.m, + control/system/tfout.m, control/system/zpout.m, + control/util/prompt.m, control/util/sortcom.m, + control/util/strappend.m, finance/fv.m, finance/nper.m, + finance/pmt.m, finance/pv.m, finance/rate.m, general/diff.m, + general/num2str.m, general/repmat.m, general/sortrows.m, + general/strerror.m, image/colormap.m, image/imshow.m, + image/loadimage.m, image/saveimage.m, linear-algebra/norm.m, + miscellaneous/fileparts.m, miscellaneous/popen2.m, + plot/__axis_label__.m, plot/__errcomm__.m, plot/__plt1__.m, + plot/__plt2__.m, plot/__plt__.m, plot/__pltopt1__.m, + plot/__pltopt__.m, plot/axis.m, plot/bottom_title.m, plot/close.m, + plot/grid.m, plot/hist.m, plot/plot_border.m, plot/polar.m, + plot/print.m, plot/title.m, plot/top_title.m, + polynomial/polyout.m, set/unique.m, signal/freqz.m, signal/stft.m, + statistics/base/mean.m, statistics/base/moment.m, + statistics/tests/cor_test.m, + statistics/tests/kolmogorov_smirnov_test.m, + statistics/tests/kolmogorov_smirnov_test_2.m, + statistics/tests/prop_test_2.m, statistics/tests/sign_test.m, + statistics/tests/t_test.m, statistics/tests/t_test_2.m, + statistics/tests/t_test_regression.m, statistics/tests/u_test.m, + statistics/tests/var_test.m, statistics/tests/welch_test.m, + statistics/tests/wilcoxon_test.m, statistics/tests/z_test.m, + statistics/tests/z_test_2.m, strings/base2dec.m, strings/blanks.m, + strings/deblank.m, strings/dec2base.m, strings/index.m, + strings/rindex.m, strings/split.m, strings/str2mat.m, + strings/str2num.m, strings/strcat.m, strings/strcmpi.m, + strings/strncmp.m, strings/strrep.m, strings/substr.m: + Avoid deprecated functions. Use ischar instead of isstr. Use + isvector instead of is_vector. Use isstruct instead of + is_struct. Use char instead of setstr. + 2005-08-31 Daniel <durbano@shbano.com> * special-matrix/invhilb.m, statistics/base/iqr.m,
--- a/scripts/audio/playaudio.m +++ b/scripts/audio/playaudio.m @@ -34,7 +34,7 @@ usage_msg = "playaudio (name, ext) or playaudio (X)"; - if (nargin == 1 && isvector (name) && ! isstr (name)) + if (nargin == 1 && isvector (name) && ! ischar (name)) ## play a vector [nr, nc] = size (name); if (nc != 1) @@ -55,7 +55,7 @@ unwind_protect_cleanup unlink (file); end_unwind_protect - elseif (nargin >= 1 && isstr (name)) + elseif (nargin >= 1 && ischar (name)) ## play a file if (nargin == 1) name = [name, ".lin"];
--- a/scripts/control/base/__bodquist__.m +++ b/scripts/control/base/__bodquist__.m @@ -74,10 +74,10 @@ if (isempty(inputs)) inputs = 1:mm; # use all inputs warning([rname,": outputs specified but not inputs"]); - elseif(is_signal_list(inputs) | isstr(inputs)) + elseif(is_signal_list(inputs) | ischar(inputs)) inputs = sysidx(sys,"in",inputs); endif - if(is_signal_list(outputs) | isstr(outputs)) + if(is_signal_list(outputs) | ischar(outputs)) outputs = sysidx(sys,"out",outputs); end sys = sysprune(sys,outputs,inputs);
--- a/scripts/control/base/lqg.m +++ b/scripts/control/base/lqg.m @@ -99,7 +99,7 @@ endif ## check for names of signals - if(is_signal_list(input_list) | isstr(input_list)) + if(is_signal_list(input_list) | ischar(input_list)) input_list = sysidx(sys,"in",input_list); endif
--- a/scripts/control/obsolete/dezero.m +++ b/scripts/control/obsolete/dezero.m @@ -36,7 +36,7 @@ if (nargin != 1) usage ("dezero (s)"); - elseif (isstr (s)) + elseif (ischar (s)) [nr, nc] = size (s); len = nr * nc; @@ -49,7 +49,7 @@ ## need to remove zeros first, then call deblank s = toascii (s); - t = deblank(setstr(s(find(s != 0) ))); + t = deblank(char(s(find(s != 0) ))); endif else
--- a/scripts/control/system/__syschnamesl__.m +++ b/scripts/control/system/__syschnamesl__.m @@ -106,8 +106,8 @@ endif ## just in case it's not a string anymore - if( !isstr(old_names) ) - old_names = setstr(old_names); + if( !ischar(old_names) ) + old_names = char(old_names); endif ## disp("__syschnamesl__: exit, old_names=")
--- a/scripts/control/system/__sysconcat__.m +++ b/scripts/control/system/__sysconcat__.m @@ -2,10 +2,10 @@ # c = __sysconcat__(a,b) # cell array replacement for append, used by control systems toolbox - if(isstr(a)) + if(ischar(a)) a = {a}; endif - if(isstr(b)) + if(ischar(b)) b = {b}; endif
--- a/scripts/control/system/c2d.m +++ b/scripts/control/system/c2d.m @@ -107,12 +107,12 @@ error("sys must be a system data structure"); elseif (nargin == 1) opt = "ex"; - elseif (nargin == 2 & !isstr(opt) ) + elseif (nargin == 2 & !ischar(opt) ) T = opt; opt = "ex"; endif - if (! isstr (opt)) + if (! ischar (opt)) error ("expecting option as a string"); endif
--- a/scripts/control/system/cellidx.m +++ b/scripts/control/system/cellidx.m @@ -40,7 +40,7 @@ usage("idxvec = cellidx(listvar,strlist)"); endif -if(isstr(strlist)) +if(ischar(strlist)) tmp = strlist; strlist = {}; for kk=1:rows(tmp) @@ -48,7 +48,7 @@ endfor endif -if(isstr(listvar)) +if(ischar(listvar)) tmp = listvar; listvar = {}; for kk=1:rows(tmp)
--- a/scripts/control/system/d2c.m +++ b/scripts/control/system/d2c.m @@ -73,7 +73,7 @@ elseif(nargin == 1) opt = "log"; tol = 1e-12; - elseif(isstr(opt)) # all remaining cases are for nargin == 2 + elseif(ischar(opt)) # all remaining cases are for nargin == 2 tol = 1e-12; if( !(strcmp(opt,"log") | strcmp(opt,"bi") ) ) error(["d2c: invalid opt passed=",opt]);
--- a/scripts/control/system/dmr2d.m +++ b/scripts/control/system/dmr2d.m @@ -87,7 +87,7 @@ endif - if(is_signal_list(idx) | isstr(idx)) + if(is_signal_list(idx) | ischar(idx)) idx = sysidx(sys,"st",idx); elseif (!(isvector(idx) | isempty(idx)))
--- a/scripts/control/system/is_signal_list.m +++ b/scripts/control/system/is_signal_list.m @@ -29,7 +29,7 @@ end if (flg) for ii = 1:length (mylist) - if (! (isstr (mylist{ii}) && rows (mylist{ii}) == 1)) + if (! (ischar (mylist{ii}) && rows (mylist{ii}) == 1)) flg = 0; endif endfor
--- a/scripts/control/system/listidx.m +++ b/scripts/control/system/listidx.m @@ -41,7 +41,7 @@ usage("idxvec = listidx(listvar,strlist)"); endif -if(isstr(strlist)) +if(ischar(strlist)) tmp = strlist; strlist = list(); for kk=1:rows(tmp) @@ -49,7 +49,7 @@ endfor endif -if(isstr(listvar)) +if(ischar(listvar)) tmp = listvar; listvar = list(); for kk=1:rows(tmp)
--- a/scripts/control/system/ss.m +++ b/scripts/control/system/ss.m @@ -218,7 +218,7 @@ ## check for continuous states if( (nargin < 6) & (tsam == 0) ) n = na; elseif(nargin < 6) n = 0; - elseif((!ismatrix(n)) | isstr(n)) + elseif((!ismatrix(n)) | ischar(n)) error("Parameter n is not a numerical value."); elseif( (!isscalar(n)) | (n < 0 ) | (n != round(n)) ) if(isscalar(n)) error("invalid value of n=%d,%e",n,n); @@ -229,7 +229,7 @@ ## check for num discrete states if( (nargin < 7) & (tsam == 0)) nz = 0; elseif(nargin < 7) nz = na - n; - elseif((!ismatrix(nz)) | isstr(nz)) + elseif((!ismatrix(nz)) | ischar(nz)) error("Parameter nz is not a numerical value."); elseif( (!isscalar(nz)) | (nz < 0 ) | (nz != round(nz)) ) if(isscalar(nz))
--- a/scripts/control/system/sysappend.m +++ b/scripts/control/system/sysappend.m @@ -111,7 +111,7 @@ if(Bm != Am) ## construct new signal names if(nargin >= 6) # new names were passed - if(!isstr(inname)) + if(!ischar(inname)) error("inname must be a string"); elseif(rows(inname) != (Bm - Am)) error(sprintf("%d new inputs requested; inname(%dx%d)", ... @@ -144,7 +144,7 @@ ## construct new signal names, output classification if(nargin >= 5) # new names were passed - if(!isstr(outname)) + if(!ischar(outname)) error("outname must be a string"); elseif(rows(outname) != (Bp - Ap)) error(sprintf("%d new outputs requested; outname(%dx%d)", ...
--- a/scripts/control/system/sysconnect.m +++ b/scripts/control/system/sysconnect.m @@ -96,10 +96,10 @@ endif ## convert signal names to indices - if(is_signal_list(input_list) | isstr(input_list)) + if(is_signal_list(input_list) | ischar(input_list)) input_list = sysidx(sys,"in",input_list); endif - if(is_signal_list(output_list) | isstr(output_list)) + if(is_signal_list(output_list) | ischar(output_list)) output_list = sysidx(sys,"out",output_list); endif
--- a/scripts/control/system/sysdup.m +++ b/scripts/control/system/sysdup.m @@ -74,10 +74,10 @@ [aa,bb,cc,dd] = sys2ss(Asys); ## check for signal names - if(is_signal_list(input_list) | isstr(input_list)) + if(is_signal_list(input_list) | ischar(input_list)) input_list = sysidx(Asys,"in",input_list); endif - if(is_signal_list(output_list) | isstr(output_list)) + if(is_signal_list(output_list) | ischar(output_list)) output_list = sysidx(Asys,"out",output_list); endif
--- a/scripts/control/system/sysgetsignals.m +++ b/scripts/control/system/sysgetsignals.m @@ -160,7 +160,7 @@ inname = sysgetsignals(sys,"in"); outname = sysgetsignals(sys,"out"); yd = sysgetsignals(sys,"yd"); - elseif(!(isstr(sigid) & min(size(sigid)) == 1)) + elseif(!(ischar(sigid) & min(size(sigid)) == 1)) error(sprintf("sigid(%dx%d) must be a string)",rows(sigid),columns(sigid))); else if(strcmp("st",sigid)) stname = sys.stname; @@ -172,7 +172,7 @@ sigid)); endif if(nargin >= 3) - if( is_signal_list(signum) | isstr(signum) ) + if( is_signal_list(signum) | ischar(signum) ) signum = cellidx(stname,signum); end if(max(signum) > length(stname))
--- a/scripts/control/system/sysidx.m +++ b/scripts/control/system/sysidx.m @@ -31,7 +31,7 @@ usage ("idxvec = sysidx (sys, sigtype, signamelist)"); elseif (! isstruct (sys)) error ("sys must be a system data structure"); - elseif (! isstr (sigtype)) + elseif (! ischar (sigtype)) error ("sigtype must be a string"); elseif (rows (sigtype) != 1) [nr, nc] = size (sigtype);
--- a/scripts/control/system/sysprune.m +++ b/scripts/control/system/sysprune.m @@ -73,10 +73,10 @@ if(isempty(state_idx)) state_idx = 1:(nn+nz); endif ## check for signal names - if(is_signal_list(output_idx) | isstr(output_idx)) + if(is_signal_list(output_idx) | ischar(output_idx)) output_idx = sysidx(sys,"out",output_idx); endif - if(is_signal_list(input_idx) | isstr(input_idx)) + if(is_signal_list(input_idx) | ischar(input_idx)) input_idx = sysidx(sys,"in",input_idx); endif
--- a/scripts/control/system/syssetsignals.m +++ b/scripts/control/system/syssetsignals.m @@ -101,13 +101,13 @@ error("sys must be a system data structure"); elseif (isempty(opt)) opt = "out"; - elseif( ! isstr(opt) ) + elseif( ! ischar(opt) ) error("opt must be a string"); elseif( ! (strcmp(opt,"out") + strcmp(opt,"yd") + ... strcmp(opt,"in") + strcmp(opt,"st") ) ) error("opt must be one of [], ""out"", ""yd"", ""in"", or ""st"""); elseif(nargin == 4) - if(is_signal_list(sig_idx) | isstr(sig_idx)) + if(is_signal_list(sig_idx) | ischar(sig_idx)) ## convert to vector of indices if(opt == "yd") sig_idx = sysidx(sys,"out",sig_idx); @@ -137,7 +137,7 @@ names = {names}; endif if( (!is_signal_list(names)) & (!isempty(names)) ) - if(isstr(names{1})) + if(ischar(names{1})) warning("syssetsignals(opt=%s): converting string matrix \"names\" to a cell array of strings",opt); tmpstr = names{1}; for ii=1:rows(tmpstr)
--- a/scripts/control/system/tfout.m +++ b/scripts/control/system/tfout.m @@ -45,7 +45,7 @@ if (nargin == 2) x = "s"; - elseif( ! isstr(x) ) + elseif( ! ischar(x) ) error("tfout: third argument must be a string"); endif
--- a/scripts/control/system/zpout.m +++ b/scripts/control/system/zpout.m @@ -49,7 +49,7 @@ if (nargin == 3) x = "s"; - elseif( ! isstr(x) ) + elseif( ! ischar(x) ) error("zpout: third argument must be a string"); endif
--- a/scripts/control/util/prompt.m +++ b/scripts/control/util/prompt.m @@ -41,7 +41,7 @@ usage ("prompt ([str])"); elseif (nargin == 0) str = "\n ---- Press a key to continue ---"; - elseif (! isstr (str) ) + elseif (! ischar (str) ) error ("prompt: input must be a string"); endif
--- a/scripts/control/util/sortcom.m +++ b/scripts/control/util/sortcom.m @@ -61,7 +61,7 @@ if(nargin == 1) opt = "re"; else - if (!isstr(opt)) + if (!ischar(opt)) error("sortcom: second argument must be a string"); endif endif
--- a/scripts/control/util/strappend.m +++ b/scripts/control/util/strappend.m @@ -28,7 +28,7 @@ usage ("retval = strappend (strlist, suffix)"); elseif (! is_signal_list (strlist)) error ("strlist must be a list of strings (see is_signal_list)"); - elseif (! (isstr (suffix) && rows (suffix) == 1)) + elseif (! (ischar (suffix) && rows (suffix) == 1)) error ("suffix must be a single string"); endif
--- a/scripts/finance/fv.m +++ b/scripts/finance/fv.m @@ -59,10 +59,10 @@ if (nargin > 3) if (nargin == 5) - if (! isstr (m)) + if (! ischar (m)) error ("fv: `method' must be a string"); endif - elseif isstr (l) + elseif ischar (l) m = l; l = 0; else
--- a/scripts/finance/nper.m +++ b/scripts/finance/nper.m @@ -53,11 +53,11 @@ endif if (nargin == 5) - if (! isstr (m)) + if (! ischar (m)) error ("nper: `method' must be a string"); endif elseif (nargin == 4) - if (isstr (l)) + if (ischar (l)) m = l; l = 0; else
--- a/scripts/finance/pmt.m +++ b/scripts/finance/pmt.m @@ -50,11 +50,11 @@ endif if (nargin == 5) - if (! isstr (m)) + if (! ischar (m)) error ("pmt: `method' must be a string"); endif elseif (nargin == 4) - if (isstr (l)) + if (ischar (l)) m = l; l = 0; else
--- a/scripts/finance/pv.m +++ b/scripts/finance/pv.m @@ -60,10 +60,10 @@ if (nargin > 3) if (nargin == 5) - if (! isstr (m)) + if (! ischar (m)) error ("pv: `method' must be a string"); endif - elseif (isstr (l)) + elseif (ischar (l)) m = l; l = 0; else
--- a/scripts/finance/rate.m +++ b/scripts/finance/rate.m @@ -50,11 +50,11 @@ endif if (nargin == 5) - if (! isstr (m)) + if (! ischar (m)) error ("rate: `method' must be a string"); endif elseif (nargin == 4) - if (isstr (l)) + if (ischar (l)) m = l; l = 0; else
--- a/scripts/general/diff.m +++ b/scripts/general/diff.m @@ -85,7 +85,7 @@ endif endif - if (isstr (x)) + if (ischar (x)) error ("diff: symbolic differentiation not (yet) supported"); endif
--- a/scripts/general/num2str.m +++ b/scripts/general/num2str.m @@ -36,14 +36,14 @@ usage ("num2str (x) or num2str (x, precision) or num2str (x, fmt)"); endif - if (isstr (x)) + if (ischar (x)) retval = x; return; endif if (iscomplex (x)) if (nargin == 2) - if (isstr (arg)) + if (ischar (arg)) fmt = strcat (arg, "%-+", arg(2:end), "i"); else if (isnumeric (x) && round (x) == x && abs (x) < (10 .^ arg)) @@ -106,7 +106,7 @@ retval = split (tmp, "\n"); else if (nargin == 2) - if (isstr (arg)) + if (ischar (arg)) fmt = arg; else if (isnumeric (x) && round (x) == x && abs (x) < (10 .^ arg))
--- a/scripts/general/repmat.m +++ b/scripts/general/repmat.m @@ -52,8 +52,8 @@ endif if (numel (a) == 1) - if (isstr (a)) - x = setstr (toascii (a) * ones (idx)); + if (ischar (a)) + x = char (toascii (a) * ones (idx)); else if (strcmp (class (a), "double")) ## This is faster with octave for double/Complex @@ -67,8 +67,8 @@ endif endif elseif (ndims (a) == 2 && length (idx) < 3) - if (isstr (a)) - x = setstr (kron (ones (idx), toascii (a))); + if (ischar (a)) + x = char (kron (ones (idx), toascii (a))); elseif (strcmp (class(a), "double")) x = kron (ones (idx), a); else
--- a/scripts/general/sortrows.m +++ b/scripts/general/sortrows.m @@ -35,7 +35,7 @@ indices = c(:); endif - if (isstr (m)) + if (ischar (m)) s = toascii (m); else s = m; @@ -53,8 +53,8 @@ i = i(idx); endfor - if (isstr (m)) - s = setstr (s); + if (ischar (m)) + s = char (s); endif endfunction
--- a/scripts/general/strerror.m +++ b/scripts/general/strerror.m @@ -33,7 +33,7 @@ usage ("strerror (name, err)"); endif - if (! isstr (name)) + if (! ischar (name)) error ("strerror: first argument must be a string"); endif
--- a/scripts/image/colormap.m +++ b/scripts/image/colormap.m @@ -47,7 +47,7 @@ if (nargin == 1) - if (isstr (map)) + if (ischar (map)) if (strcmp (map, "default")) map = gray (); else
--- a/scripts/image/imshow.m +++ b/scripts/image/imshow.m @@ -153,7 +153,7 @@ ## Check for "truesize". zoom = []; for i = mvars+1:nargin - if (isstr (varargin{i}) && strcmp (varargin{i}, "truesize")) + if (ischar (varargin{i}) && strcmp (varargin{i}, "truesize")) zoom = 1; endif endfor
--- a/scripts/image/loadimage.m +++ b/scripts/image/loadimage.m @@ -33,7 +33,7 @@ if (nargin != 1) usage ("[img, map] = loadimage (filename)"); - elseif (! isstr (filename)) + elseif (! ischar (filename)) error ("loadimage: expecting filename as a string"); endif
--- a/scripts/image/saveimage.m +++ b/scripts/image/saveimage.m @@ -93,7 +93,7 @@ if (nargin < 3) img_form = "img"; - elseif (! isstr (img_form)) + elseif (! ischar (img_form)) error ("image format specification must be a string"); elseif (! (strcmp (img_form, "img") || strcmp (img_form, "ppm") @@ -105,7 +105,7 @@ warning ("image variable is not a matrix"); endif - if (! isstr (filename)) + if (! ischar (filename)) error ("file name must be a string"); endif
--- a/scripts/linear-algebra/norm.m +++ b/scripts/linear-algebra/norm.m @@ -78,7 +78,7 @@ if (rows (x) == 1 || columns (x) == 1) if (nargin == 2) - if (isstr (p)) + if (ischar (p)) if (strcmp (p, "fro")) retval = sqrt (sum (abs (x) .^ 2)); elseif (strcmp (p, "inf")) @@ -102,7 +102,7 @@ else if (nargin == 2) - if (isstr (p)) + if (ischar (p)) if (strcmp (p, "fro")) retval = sqrt (sum (sum (abs (x) .^ 2))); elseif (strcmp (p, "inf"))
--- a/scripts/miscellaneous/fileparts.m +++ b/scripts/miscellaneous/fileparts.m @@ -26,7 +26,7 @@ function [directory, name, extension, version] = fileparts (filename) if (nargin == 1) - if (isstr (filename)) + if (ischar (filename)) ds = rindex (filename, filesep); es = rindex (filename, "."); ## These can be the same if they are both 0 (no dir or ext).
--- a/scripts/miscellaneous/popen2.m +++ b/scripts/miscellaneous/popen2.m @@ -34,7 +34,7 @@ ## [in, out, pid] = popen2 ("sort", "-nr"); ## fputs (in, "these\nare\nsome\nstrings\n"); ## fclose (in); -## while (isstr (s = fgets (out))) +## while (ischar (s = fgets (out))) ## fputs (stdout, s); ## endwhile ## fclose (out); @@ -60,7 +60,7 @@ args = ""; endif - if (isstr (command)) + if (ischar (command)) [stdin_pipe, stdin_status] = pipe (); [stdout_pipe, stdout_status] = pipe ();
--- a/scripts/plot/__axis_label__.m +++ b/scripts/plot/__axis_label__.m @@ -29,7 +29,7 @@ if (nargin == 0) usage ("__axis_label__ (caller, text)"); elseif (nargin == 2) - if (isstr (text)) + if (ischar (text)) __gnuplot_raw__ (sprintf ("set %s \"%s\";\n", caller, undo_string_escapes (text))); if (automatic_replot)
--- a/scripts/plot/__errcomm__.m +++ b/scripts/plot/__errcomm__.m @@ -59,7 +59,7 @@ data{ndata} = a; while (k <= nargs) a = varargin{k++}; - if (isstr (a)) + if (ischar (a)) __errplot__ (a, data{1:ndata}); break; elseif (isvector (a)) @@ -79,7 +79,7 @@ endwhile endwhile - if (! isstr (a)) + if (! ischar (a)) __errplot__ ("~", data{1:ndata}); endif unwind_protect_cleanup
--- a/scripts/plot/__plt1__.m +++ b/scripts/plot/__plt1__.m @@ -33,7 +33,7 @@ fmt = ""; endif - if (! isstr (fmt)) + if (! ischar (fmt)) error ("__plt1__: fmt must be a string"); endif
--- a/scripts/plot/__plt2__.m +++ b/scripts/plot/__plt2__.m @@ -33,7 +33,7 @@ fmt = ""; endif - if (! isstr (fmt)) + if (! ischar (fmt)) error ("__plt2__: fmt must be a string"); endif
--- a/scripts/plot/__plt__.m +++ b/scripts/plot/__plt__.m @@ -50,7 +50,7 @@ have_data = false; - if (isstr (next_arg)) + if (ischar (next_arg)) if (x_set) fmt = __pltopt__ (caller, next_arg); if (y_set)
--- a/scripts/plot/__pltopt1__.m +++ b/scripts/plot/__pltopt1__.m @@ -65,7 +65,7 @@ usage ("__pltopt1__ (caller, opt)"); endif - if (! isstr (opt)) + if (! ischar (opt)) error ("__pltopt1__: argument must be a string"); endif
--- a/scripts/plot/__pltopt__.m +++ b/scripts/plot/__pltopt__.m @@ -111,7 +111,7 @@ function fmt = __pltopt__ (caller, opt) - if (! isstr (opt)) + if (! ischar (opt)) usage ("__pltopt__ (caller, opt)"); endif
--- a/scripts/plot/axis.m +++ b/scripts/plot/axis.m @@ -134,7 +134,7 @@ curr_axis = __current_axis__; endif - elseif (isstr (ax)) + elseif (ischar (ax)) ax = tolower (ax); len = length (ax);
--- a/scripts/plot/bottom_title.m +++ b/scripts/plot/bottom_title.m @@ -31,7 +31,7 @@ usage ("bottom_title (text)"); endif - if (isstr (text)) + if (ischar (text)) __gnuplot_raw__ ("set top_title;\n"); __gnuplot_raw__ ("set title;\n"); __gnuplot_raw__ (sprintf ("set bottom_title \"%s\";\n",
--- a/scripts/plot/close.m +++ b/scripts/plot/close.m @@ -40,7 +40,7 @@ endif closeplot; elseif (nargin == 1) - if (isstr (arg1)) + if (ischar (arg1)) if (strcmp (arg1, "all")) closeplot; else @@ -56,8 +56,8 @@ endif endif elseif (nargin == 2 - && isstr (arg1) && strcmp (arg1, "all") - && isstr (arg2) && strcmp (arg2, "hidden")) + && ischar (arg1) && strcmp (arg1, "all") + && ischar (arg2) && strcmp (arg2, "hidden")) closeplot; else usage ("close [all]");
--- a/scripts/plot/grid.m +++ b/scripts/plot/grid.m @@ -41,7 +41,7 @@ __gnuplot_raw__ ("set grid;\n"); do_replot = true; elseif (nargin == 1) - if (isstr (x)) + if (ischar (x)) if (strcmp ("off", x)) __gnuplot_raw__ ("set nogrid;\n"); do_replot = true;
--- a/scripts/plot/hist.m +++ b/scripts/plot/hist.m @@ -50,7 +50,7 @@ usage ("[nn, xx] = hist (y, x, norm)"); endif - arg_is_vector = is_vector (y); + arg_is_vector = isvector (y); if (rows (y) == 1) y = y(:);
--- a/scripts/plot/plot_border.m +++ b/scripts/plot/plot_border.m @@ -68,7 +68,7 @@ arg = varargin{k++}; - if (! isstr (arg)) + if (! ischar (arg)) error ("plot_border: input not a string"); endif
--- a/scripts/plot/polar.m +++ b/scripts/plot/polar.m @@ -40,12 +40,12 @@ __gnuplot_raw__ ("set nopolar;\n"); if (nargin == 3) - if (! isstr (fmt)) + if (! ischar (fmt)) error ("polar: third argument must be a string"); endif __plr2__ (x1, x2, fmt); elseif (nargin == 2) - if (isstr (x2)) + if (ischar (x2)) __plr1__ (x1, x2); else fmt = "";
--- a/scripts/plot/print.m +++ b/scripts/plot/print.m @@ -110,7 +110,7 @@ for i = 1:nargin arg = varargin{i}; - if (isstr (arg)) + if (ischar (arg)) if (strcmp (arg, "-color")) use_color = 1; elseif (strcmp (arg, "-mono"))
--- a/scripts/plot/title.m +++ b/scripts/plot/title.m @@ -33,7 +33,7 @@ usage ("title (text)"); endif - if (isstr (text)) + if (ischar (text)) __gnuplot_raw__ (sprintf ("set title \"%s\";\n", undo_string_escapes (text))); if (automatic_replot)
--- a/scripts/plot/top_title.m +++ b/scripts/plot/top_title.m @@ -33,7 +33,7 @@ usage ("top_title (text)"); endif - if (isstr (text)) + if (ischar (text)) __gnuplot_raw__ ("set bottom_title;\n") __gnuplot_raw__ ("set title;\n") __gnuplot_raw__ (sprintf ("set top_title \"%s\";\n",
--- a/scripts/polynomial/polyout.m +++ b/scripts/polynomial/polyout.m @@ -54,7 +54,7 @@ if (nargin == 1) x = "s"; - elseif (! isstr(x)) + elseif (! ischar(x)) error("polyout: second argument must be a string"); endif
--- a/scripts/set/unique.m +++ b/scripts/set/unique.m @@ -55,7 +55,7 @@ return; endif - if (isstr (x)) + if (ischar (x)) y = toascii (y); endif @@ -95,8 +95,8 @@ endif i(idx) = []; - if (isstr (x)) - y = setstr (y); + if (ischar (x)) + y = char (y); endif endfunction
--- a/scripts/signal/freqz.m +++ b/scripts/signal/freqz.m @@ -84,7 +84,7 @@ region = Fs = []; elseif (nargin == 4) Fs = []; - if (! isstr (region) && ! isempty (region)) + if (! ischar (region) && ! isempty (region)) Fs = region; region = []; endif
--- a/scripts/signal/stft.m +++ b/scripts/signal/stft.m @@ -69,7 +69,7 @@ endif endif elseif (nargin == 5) - if (isstr (w_type)) + if (ischar (w_type)) if (strcmp (w_type, "hanning")) w_type = 1; elseif (strcmp (w_type, "hamming"))
--- a/scripts/statistics/base/mean.m +++ b/scripts/statistics/base/mean.m @@ -66,7 +66,7 @@ opt = "a"; need_dim = 1; elseif (nargin == 2) - if (isstr (opt1)) + if (ischar (opt1)) opt = opt1; need_dim = 1; else @@ -74,10 +74,10 @@ opt = "a"; endif elseif (nargin == 3) - if (isstr (opt1)) + if (ischar (opt1)) opt = opt1; dim = opt2; - elseif (isstr (opt2)) + elseif (ischar (opt2)) opt = opt2; dim = opt1; else
--- a/scripts/statistics/base/moment.m +++ b/scripts/statistics/base/moment.m @@ -57,7 +57,7 @@ opt = ""; need_dim = 1; elseif (nargin == 3) - if (isstr (opt1)) + if (ischar (opt1)) opt = opt1; need_dim = 1; else @@ -65,10 +65,10 @@ opt = ""; endif elseif (nargin == 4) - if (isstr (opt1)) + if (ischar (opt1)) opt = opt1; dim = opt2; - elseif (isstr (opt2)) + elseif (ischar (opt2)) opt = opt2; dim = opt1; else
--- a/scripts/statistics/tests/cor_test.m +++ b/scripts/statistics/tests/cor_test.m @@ -73,13 +73,13 @@ if (nargin < 3) ALTERNATIVE = "!="; - elseif (! isstr (ALTERNATIVE)) + elseif (! ischar (ALTERNATIVE)) error ("cor_test: ALTERNATIVE must be a string"); endif if (nargin < 4) METHOD = "pearson"; - elseif (! isstr (METHOD)) + elseif (! ischar (METHOD)) error ("cor_test: METHOD must be a string"); endif
--- a/scripts/statistics/tests/kolmogorov_smirnov_test.m +++ b/scripts/statistics/tests/kolmogorov_smirnov_test.m @@ -72,7 +72,7 @@ args = ""; for k = 1 : (nargin-2); tmp = varargin{k}; - if isstr (tmp) + if ischar (tmp) alt = tmp; else args = sprintf ("%s, %g", args, tmp);
--- a/scripts/statistics/tests/kolmogorov_smirnov_test_2.m +++ b/scripts/statistics/tests/kolmogorov_smirnov_test_2.m @@ -59,7 +59,7 @@ if (nargin == 2) alt = "!="; else - if (! isstr (alt)) + if (! ischar (alt)) error ("kolmogorov_smirnov_test_2: alt must be a string"); endif endif
--- a/scripts/statistics/tests/prop_test_2.m +++ b/scripts/statistics/tests/prop_test_2.m @@ -61,7 +61,7 @@ alt = "!="; endif - if (! isstr (alt)) + if (! ischar (alt)) error ("prop_test_2: alt must be a string"); endif if (strcmp (alt, "!=") || strcmp (alt, "<>"))
--- a/scripts/statistics/tests/sign_test.m +++ b/scripts/statistics/tests/sign_test.m @@ -64,7 +64,7 @@ alt = "!="; endif - if (! isstr (alt)) + if (! ischar (alt)) error ("sign_test: alt must be a string"); endif if (strcmp (alt, "!=") || strcmp (alt, "<>"))
--- a/scripts/statistics/tests/t_test.m +++ b/scripts/statistics/tests/t_test.m @@ -64,7 +64,7 @@ alt = "!="; endif - if (! isstr (alt)) + if (! ischar (alt)) error ("t_test: alt must be a string"); endif if (strcmp (alt, "!=") || strcmp (alt, "<>"))
--- a/scripts/statistics/tests/t_test_2.m +++ b/scripts/statistics/tests/t_test_2.m @@ -65,7 +65,7 @@ alt = "!="; endif - if (! isstr (alt)) + if (! ischar (alt)) error ("t_test_2: alt must be a string"); endif if (strcmp (alt, "!=") || strcmp (alt, "<>"))
--- a/scripts/statistics/tests/t_test_regression.m +++ b/scripts/statistics/tests/t_test_regression.m @@ -48,7 +48,7 @@ r = 0; alt = "!="; elseif (nargin == 4) - if (isstr (r)) + if (ischar (r)) alt = r; r = 0; else @@ -60,7 +60,7 @@ if (! isscalar (r)) error ("t_test_regression: r must be a scalar"); - elseif (! isstr (alt)) + elseif (! ischar (alt)) error ("t_test_regression: alt must be a string"); endif
--- a/scripts/statistics/tests/u_test.m +++ b/scripts/statistics/tests/u_test.m @@ -66,7 +66,7 @@ alt = "!="; endif - if (! isstr (alt)) + if (! ischar (alt)) error("u_test: alt must be a string"); endif if (strcmp (alt, "!=") || strcmp (alt, "<>"))
--- a/scripts/statistics/tests/var_test.m +++ b/scripts/statistics/tests/var_test.m @@ -60,7 +60,7 @@ alt = "!="; endif - if (! isstr (alt)) + if (! ischar (alt)) error ("var_test: alt must be a string"); endif if (strcmp (alt, "!=") || strcmp (alt, "<>"))
--- a/scripts/statistics/tests/welch_test.m +++ b/scripts/statistics/tests/welch_test.m @@ -66,7 +66,7 @@ alt = "!="; endif - if (! isstr (alt)) + if (! ischar (alt)) error ("welch_test: alt must be a string"); endif if (strcmp (alt, "!=") || strcmp (alt, "<>"))
--- a/scripts/statistics/tests/wilcoxon_test.m +++ b/scripts/statistics/tests/wilcoxon_test.m @@ -70,7 +70,7 @@ alt = "!="; endif - if (! isstr (alt)) + if (! ischar (alt)) error("wilcoxon_test: alt must be a string"); elseif (strcmp (alt, "!=") || strcmp (alt, "<>")) pval = 2 * min (cdf, 1 - cdf);
--- a/scripts/statistics/tests/z_test.m +++ b/scripts/statistics/tests/z_test.m @@ -66,7 +66,7 @@ alt = "!="; endif - if (! isstr (alt)) + if (! ischar (alt)) error ("z_test: alt must be a string"); elseif (strcmp (alt, "!=") || strcmp (alt, "<>")) pval = 2 * min (cdf, 1 - cdf);
--- a/scripts/statistics/tests/z_test_2.m +++ b/scripts/statistics/tests/z_test_2.m @@ -66,7 +66,7 @@ alt = "!="; endif - if (! isstr (alt)) + if (! ischar (alt)) error ("z_test_2: alt must be a string"); elseif (strcmp (alt, "!=") || strcmp (alt, "<>")) pval = 2 * min (cdf, 1 - cdf);
--- a/scripts/strings/base2dec.m +++ b/scripts/strings/base2dec.m @@ -55,7 +55,7 @@ endif symbols = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - if (isstr (base)) + if (ischar (base)) symbols = base; base = length (symbols); if (any (diff (sort (toascii (symbols))) == 0))
--- a/scripts/strings/blanks.m +++ b/scripts/strings/blanks.m @@ -32,7 +32,7 @@ endif if (isscalar (n) && n == round (n)) - s = setstr (ones (1, n) * toascii (" ")); + s = char (ones (1, n) * toascii (" ")); else error ("blanks: n must be a non-negative integer"); endif
--- a/scripts/strings/deblank.m +++ b/scripts/strings/deblank.m @@ -33,7 +33,7 @@ usage ("deblank (s)"); endif - if (isstr (s)) + if (ischar (s)) k = find (! isspace (s) & s != "\0"); if (isempty (s) || isempty (k))
--- a/scripts/strings/dec2base.m +++ b/scripts/strings/dec2base.m @@ -61,7 +61,7 @@ endif symbols = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - if (isstr (base)) + if (ischar (base)) symbols = base; base = length (symbols); if any (diff (sort (toascii (symbols))) == 0)
--- a/scripts/strings/index.m +++ b/scripts/strings/index.m @@ -41,7 +41,7 @@ usage ("index (s, t)"); endif - if (!isstr (s) || !isstr (t) || all (size (s) > 1) || all (size (t) > 1) ) + if (!ischar (s) || !ischar (t) || all (size (s) > 1) || all (size (t) > 1) ) error ("index: expecting string arguments"); endif
--- a/scripts/strings/rindex.m +++ b/scripts/strings/rindex.m @@ -41,7 +41,7 @@ usage ("rindex (s, t)"); endif - if (!isstr (s) || !isstr (t) || all (size (s) > 1) || all (size (t) > 1) ) + if (!ischar (s) || !ischar (t) || all (size (s) > 1) || all (size (t) > 1) ) error ("rindex: expecting string arguments"); endif
--- a/scripts/strings/split.m +++ b/scripts/strings/split.m @@ -37,7 +37,7 @@ function m = split (s, t) if (nargin == 2) - if (isstr (s) && isstr (t)) + if (ischar (s) && ischar (t)) l_s = length (s); l_t = length (t);
--- a/scripts/strings/str2mat.m +++ b/scripts/strings/str2mat.m @@ -44,8 +44,8 @@ nc = zeros (nargin, 1); for k = 1 : nargin s = varargin{k}; - if (! isstr (s)) - s = setstr (s); + if (! ischar (s)) + s = char (s); endif [nr(k), nc(k)] = size (s); endfor @@ -59,13 +59,13 @@ retval_nr = sum (nr); retval_nc = max (nc); - retval = setstr (ones (retval_nr, retval_nc) * toascii (" ")); + retval = char (ones (retval_nr, retval_nc) * toascii (" ")); row_offset = 0; for k = 1 : nargin s = varargin{k}; - if (! isstr (s)) - s = setstr (s); + if (! ischar (s)) + s = char (s); endif if (nc(k) > 0) retval ((row_offset + 1) : (row_offset + nr(k)), 1:nc(k)) = s;
--- a/scripts/strings/str2num.m +++ b/scripts/strings/str2num.m @@ -26,13 +26,13 @@ function m = str2num (s) - if (nargin == 1 && isstr (s)) + if (nargin == 1 && ischar (s)) [nr, nc] = size (s); sep = ";"; sep = sep (ones (nr, 1), 1); s = sprintf ("m = [%s];", reshape ([s, sep]', 1, nr * (nc + 1))); eval (s, "m = [];"); - if (isstr (m)) + if (ischar (m)) m = []; endif else
--- a/scripts/strings/strcat.m +++ b/scripts/strings/strcat.m @@ -39,7 +39,7 @@ save_warn_empty_list_elements = warn_empty_list_elements; unwind_protect warn_empty_list_elements = 0; - if (isstr (s)) + if (ischar (s)) tmpst = s; else error ("strcat: all arguments must be strings"); @@ -48,7 +48,7 @@ k = 1; while (n--) tmp = varargin{k++}; - if (isstr (tmp)) + if (ischar (tmp)) tmpst = [tmpst, tmp]; else error ("strcat: all arguments must be strings");
--- a/scripts/strings/strcmpi.m +++ b/scripts/strings/strcmpi.m @@ -33,7 +33,7 @@ function status = strcmpi(s1, s2) if (nargin == 2) - status = (isstr (s1) && isstr(s2) && strcmp (upper (s1), upper (s2))); + status = (ischar (s1) && ischar(s2) && strcmp (upper (s1), upper (s2))); else usage ("strcmpi (s, t)"); endif
--- a/scripts/strings/strncmp.m +++ b/scripts/strings/strncmp.m @@ -39,9 +39,9 @@ retval = false; - if (isstr (s1)) + if (ischar (s1)) [r1, c1] = size (s1); - if (isstr (s2)) + if (ischar (s2)) [r2, c2] = size (s2); if (r1 == r2 && c1 == c2) if (c1 == 0) @@ -102,7 +102,7 @@ endif elseif (iscellstr (s1)) [r1, c1] = size (s1); - if (isstr (s2)) + if (ischar (s2)) retval = strncmp (s2, s1, n, "logical"); elseif (iscellstr (s2)) [r2, c2] = size (s2);
--- a/scripts/strings/strrep.m +++ b/scripts/strings/strrep.m @@ -38,7 +38,7 @@ usage ("strrep (s, x, y)"); endif - if (! (isstr (s) && isstr (x) && isstr (y))) + if (! (ischar (s) && ischar (x) && ischar (y))) error ("strrep: all arguments must be strings"); endif @@ -84,7 +84,7 @@ repeat = [1:length(x)]' * ones (1, length (ind)); delete = ones (length (x), 1) * ind + repeat - 1; t(delete) = []; - t = setstr (t); + t = char (t); endif endfunction