Mercurial > hg > octave-lojdl
changeset 10635:d1978e7364ad
Print name of function in error() string messages.
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,28 @@ +2010-05-16 Rik <octave@nomad.inbox5.com> + + * audio/loadaudio.m, audio/playaudio.m, audio/saveaudio.m, + audio/wavread.m, general/bicubic.m, general/bitcmp.m, general/bitget.m, + general/bitset.m, general/cplxpair.m, general/del2.m, + general/gradient.m, general/interp2.m, general/interp3.m, + general/interpn.m, general/postpad.m, general/prepad.m, + general/private/__splinen__.m, image/image_viewer.m, image/imagesc.m, + image/saveimage.m, linear-algebra/expm.m, linear-algebra/krylov.m, + miscellaneous/edit.m, miscellaneous/private/__xzip__.m, + miscellaneous/what.m, optimization/glpk.m, optimization/optimset.m, + optimization/pqpnonneg.m, path/pathdef.m, plot/__go_draw_axes__.m, + plot/__marching_cube__.m, plot/gnuplot_drawnow.m, plot/ishold.m, + plot/isocolors.m, plot/isonormals.m, plot/print.m, + plot/private/__add_datasource__.m, plot/private/__color_str_rgb__.m, + plot/private/__errplot__.m, plot/private/__interp_cube__.m, + plot/shading.m, plot/specular.m, polynomial/deconv.m, + polynomial/polyint.m, polynomial/ppint.m, set/powerset.m, + signal/arch_fit.m, signal/arch_test.m, signal/durbinlevinson.m, + special-matrix/hadamard.m, statistics/distributions/unidrnd.m, + statistics/distributions/unifinv.m, + statistics/models/logistic_regression.m, strings/strjust.m, + testfun/rundemos.m, testfun/runtests.m, testfun/test.m, time/datenum.m: + Print name of function in error() string messages. + 2010-05-16 Rik <octave@nomad.inbox5.com> * scripts/plot/contourc.m, scripts/plot/private/__contour__.m,
--- a/scripts/audio/loadaudio.m +++ b/scripts/audio/loadaudio.m @@ -74,7 +74,7 @@ X = mu2lin (Y, bit); else fclose (num); - error ("loadaudio does not support given extension"); + error ("loadaudio: unsupported extension"); endif fclose (num);
--- a/scripts/audio/playaudio.m +++ b/scripts/audio/playaudio.m @@ -67,7 +67,7 @@ || strcmp (ext, "snd") || strcmp (ext, "ul")) system (sprintf ("cat \"%s\" > /dev/audio", name)); else - error ("playaudio does not support given extension"); + error ("playaudio: unsupported extension"); endif else print_usage ();
--- a/scripts/audio/saveaudio.m +++ b/scripts/audio/saveaudio.m @@ -81,7 +81,7 @@ c = fwrite (num, Y, "uchar"); else fclose (num); - error ("saveaudio does not support given extension"); + error ("saveaudio: unsupported extension"); endif fclose (num);
--- a/scripts/audio/wavread.m +++ b/scripts/audio/wavread.m @@ -52,7 +52,7 @@ endif if (! ischar (filename)) - error ("wavwrite: expecting filename to be a character string"); + error ("wavread: expecting filename to be a character string"); endif # Open file for binary reading.
--- a/scripts/general/bicubic.m +++ b/scripts/general/bicubic.m @@ -69,7 +69,7 @@ t = linspace (1, rz, (rz-1)*pow2(n)+1); elseif (nargin == 3) if (! isvector (X) || ! isvector (Y)) - error ("XI and YI must be vector"); + error ("bicubic: XI and YI must be vector"); endif s = Y; t = Z; @@ -79,13 +79,13 @@ [rz, cz] = size (Z) ; if (isvector (X) && isvector (Y)) if (rz != length (Y) || cz != length (X)) - error ("length of X and Y must match the size of Z"); + error ("bicubic: length of X and Y must match the size of Z"); endif elseif (size_equal (X, Y) && size_equal (X, Z)) X = X(1,:); Y = Y(:,1); else - error ("X, Y and Z must be martrices of same size"); + error ("bicubic: X, Y and Z must be equal size matrices of same size"); endif ## Mark values outside the lookup table. @@ -128,7 +128,7 @@ endif if (rz < 3 || cz < 3) - error ("Z at least a 3 by 3 matrices"); + error ("bicubic: Z at least a 3 by 3 matrices"); endif inds = floor (s);
--- a/scripts/general/bitcmp.m +++ b/scripts/general/bitcmp.m @@ -43,7 +43,7 @@ endif if (nargin == 2 && (! isscalar (n) || (floor (n) != n))) - error ("k must be a scalar integer"); + error ("bitcmp: k must be a scalar integer"); endif if (isa (a, "double")) @@ -67,7 +67,7 @@ elseif (isa (a, "int64")) amax = 64; else - error ("invalid class %s", class (a)); + error ("bitcmp: invalid class %s", class (a)); endif bmax = intmax (class (a)); endif @@ -77,7 +77,7 @@ else m = double (n); if (any (m < 1) || any (m > amax)) - error ("n must be in the range [1,%d]", amax); + error ("bitcmp: n must be in the range [1,%d]", amax); endif mask = bitshift (bmax, n - amax); x = bitxor (bitand (a, mask), mask);
--- a/scripts/general/bitget.m +++ b/scripts/general/bitget.m @@ -67,13 +67,13 @@ Amax = 64; _conv = @int64; else - error ("invalid class %s", class (A)); + error ("bitget: invalid class %s", class (A)); endif endif m = double (n(:)); if (any (m < 1) || any (m > Amax)) - error ("n must be in the range [1,%d]", Amax); + error ("bitget: n must be in the range [1,%d]", Amax); endif X = bitand (A, bitshift (_conv (1), uint8 (n) - uint8 (1))) != _conv (0);
--- a/scripts/general/bitset.m +++ b/scripts/general/bitset.m @@ -74,14 +74,14 @@ Amax = 64; _conv = @int64; else - error ("invalid class %s", class (A)); + error ("bitset: invalid class %s", class (A)); endif Bmax = intmax (class (A)); endif m = double (n(:)); if (any (m < 1) || any (m > Amax)) - error ("n must be in the range [1,%d]", Amax); + error ("bitset: n must be in the range [1,%d]", Amax); endif mask = bitshift (_conv (1), uint8 (n) - uint8 (1));
--- a/scripts/general/cplxpair.m +++ b/scripts/general/cplxpair.m @@ -119,11 +119,11 @@ p = n - nr(j); for i = 1:2:p if (i+1 > p) - error ("cplxpair could not pair all complex numbers"); + error ("cplxpair: could not pair all complex numbers"); endif [v, idx] = min (abs (z(i+1:p) - conj (z(i)))); if (v > tol) - error ("cplxpair could not pair all complex numbers"); + error ("cplxpair: could not pair all complex numbers"); endif if (imag (z(i)) < 0) y([i, i+1]) = z([i, idx+i]);
--- a/scripts/general/del2.m +++ b/scripts/general/del2.m @@ -85,7 +85,7 @@ if (length (h) == sz (i)) dx{i} = diff (h)(:); else - error ("dimensionality mismatch in %d-th spacing vector", i); + error ("del2: dimensionality mismatch in %d-th spacing vector", i); endif endif endfor @@ -102,7 +102,7 @@ if (length (varargin{i}) == sz (i)) dx{i} = diff (varargin{i})(:); else - error ("dimensionality mismatch in %d-th spacing vector", i); + error ("del2: dimensionality mismatch in %d-th spacing vector", i); endif endif endfor
--- a/scripts/general/gradient.m +++ b/scripts/general/gradient.m @@ -119,7 +119,7 @@ else ## have spacing value for each dimension if (length(varargin) != nd) - error ("dimensions and number of spacing values do not match."); + error ("gradient: dimensions and number of spacing values do not match."); end for i = 1:nd if (isscalar (varargin{i}))
--- a/scripts/general/interp2.m +++ b/scripts/general/interp2.m @@ -131,18 +131,18 @@ ## Type checking. if (!ismatrix (Z)) - error ("interp2 expected matrix Z"); + error ("interp2: expected matrix Z"); endif if (!isempty (n) && !isscalar (n)) - error ("interp2 expected scalar n"); + error ("interp2: expected scalar n"); endif if (!ischar (method)) - error ("interp2 expected string 'method'"); + error ("interp2: expected string 'method'"); endif if (ischar (extrapval) || strcmp (extrapval, "extrap")) extrapval = []; elseif (!isscalar (extrapval)) - error ("interp2 expected n extrapval"); + error ("interp2: expected n extrapval"); endif ## Define X, Y, XI, YI if needed @@ -152,7 +152,7 @@ Y = 1:zr; endif if (! isnumeric (X) || ! isnumeric (Y)) - error ("interp2 expected numeric X, Y"); + error ("interp2: expected numeric X, Y"); endif if (! isempty (n)) p = 2^n; @@ -160,7 +160,7 @@ YI = (p:p*zr)'/p; endif if (! isnumeric (XI) || ! isnumeric (YI)) - error ("interp2 expected numeric XI, YI"); + error ("interp2: expected numeric XI, YI"); endif @@ -173,10 +173,10 @@ elseif (size_equal (X, Y)) X = X(1,:)'; Y = Y(:,1); else - error ("X and Y must be matrices of same size"); + error ("interp2: X and Y must be matrices of same size"); endif if (columns (Z) != length (X) || rows (Z) != length (Y)) - error ("X and Y size must match Z dimensions"); + error ("interp2: X and Y size must match Z dimensions"); endif ## If Xi and Yi are vectors of different orientation build a grid @@ -184,7 +184,7 @@ || (columns (XI) == 1 && rows (YI) == 1)) [XI, YI] = meshgrid (XI, YI); elseif (! size_equal (XI, YI)) - error ("XI and YI must be matrices of same size"); + error ("interp2: XI and YI must be matrices of same size"); endif ## if XI, YI are vectors, X and Y should share their orientation. @@ -323,12 +323,12 @@ X = X(:).'; Y = Y(:); if (!isequal ([length(X), length(Y)], size(Z))) - error ("X and Y size must match Z dimensions"); + error ("interp2: X and Y size must match Z dimensions"); endif elseif (!size_equal (X, Y)) - error ("X and Y must be matrices of same size"); + error ("interp2: X and Y must be matrices of same size"); if (! size_equal (X, Z)) - error ("X and Y size must match Z dimensions"); + error ("interp2: X and Y size must match Z dimensions"); endif endif @@ -337,7 +337,7 @@ || (columns (XI) == 1 && rows (YI) == 1)) ## Do nothing elseif (! size_equal (XI, YI)) - error ("XI and YI must be matrices of same size"); + error ("interp2: XI and YI must be matrices of same size"); endif ## FIXME bicubic/__splinen__ don't handle arbitrary XI, YI @@ -401,7 +401,7 @@ error ("interp2: input data must have `meshgrid' format"); endif else - error ("interpolation method not recognized"); + error ("interp2: interpolation method not recognized"); endif endif
--- a/scripts/general/interp3.m +++ b/scripts/general/interp3.m @@ -75,7 +75,7 @@ nargs = nargs - 1; elseif (ischar (varargin{end-1})) if (! isnumeric (varargin{end}) || ! isscalar (varargin{end})) - error ("extrapal is expected to be a numeric scalar"); + error ("interp3: extrapal is expected to be a numeric scalar"); endif extrapval = varargin{end}; method = varargin{end-1}; @@ -86,13 +86,13 @@ && nargs == (ndims (varargin{1}) + 1))) v = varargin{1}; if (ndims (v) != 3) - error ("expect 3-dimensional array of values"); + error ("interp3: expect 3-dimensional array of values"); endif x = varargin (2:4); if (any (! cellfun (@isvector, x))) for i = 2 : 3 if (! size_equal (x{1}, x{i})) - error ("dimensional mismatch"); + error ("interp3: dimensional mismatch"); endif x{i} = permute (x{i}, [2, 1, 3]); endfor @@ -103,13 +103,13 @@ elseif (nargs == 7 && nargs == (2 * ndims (varargin{ceil (nargs / 2)})) + 1) v = varargin{4}; if (ndims (v) != 3) - error ("expect 3-dimensional array of values"); + error ("interp3: expect 3-dimensional array of values"); endif x = varargin (1:3); if (any (! cellfun (@isvector, x))) for i = 2 : 3 if (! size_equal (x{1}, x{i}) || ! size_equal (x{i}, v)) - error ("dimensional mismatch"); + error ("interp3: dimensional mismatch"); endif x{i} = permute (x{i}, [2, 1, 3]); endfor @@ -119,7 +119,7 @@ if (any (! cellfun (@isvector, y))) for i = 2 : 3 if (! size_equal (y{1}, y{i})) - error ("dimensional mismatch"); + error ("interp3: dimensional mismatch"); endif y{i} = permute (y{i}, [2, 1, 3]); endfor @@ -128,7 +128,7 @@ v = permute (v, [2, 1, 3]); vi = ipermute (interpn (x{:}, v, y{:}, method, extrapval), [2, 1, 3]); else - error ("wrong number or incorrectly formatted input arguments"); + error ("interp3: wrong number or incorrectly formatted input arguments"); endif endfunction
--- a/scripts/general/interpn.m +++ b/scripts/general/interpn.m @@ -76,7 +76,7 @@ nargs = nargs - 1; elseif (ischar (varargin{end - 1})) if (! isnumeric (varargin{end}) || ! isscalar (varargin{end})) - error ("extrapal is expected to be a numeric scalar"); + error ("interpn: extrapal is expected to be a numeric scalar"); endif method = varargin{end - 1}; extrapval = varargin{end}; @@ -89,7 +89,7 @@ if (nargs == 2) m = varargin{2}; if (! isnumeric (m) || ! isscalar (m) || floor (m) != m) - error ("m is expected to be a integer scalar"); + error ("interpn: m is expected to be a integer scalar"); endif endif sz = size (v); @@ -118,13 +118,13 @@ x = varargin (1 : (nv - 1)); y = varargin ((nv + 1) : nargs); else - error ("wrong number or incorrectly formatted input arguments"); + error ("interpn: wrong number or incorrectly formatted input arguments"); endif if (any (! cellfun (@isvector, x))) for i = 2 : nd if (! size_equal (x{1}, x{i}) || ! size_equal (x{i}, v)) - error ("dimensional mismatch"); + error ("interpn: dimensional mismatch"); endif idx (1 : nd) = {1}; idx (i) = ":"; @@ -162,7 +162,7 @@ if (any (! cellfun (@isvector, y))) for i = 2 : nd if (! size_equal (y{1}, y{i})) - error ("dimensional mismatch"); + error ("interpn: dimensional mismatch"); endif idx (1 : nd) = {1}; idx (i) = ":"; @@ -187,9 +187,9 @@ vi = reshape (vi, size(y{1})); endif elseif (strcmp (method, "cubic")) - error ("cubic interpolation not yet implemented"); + error ("interpn: cubic interpolation not yet implemented"); else - error ("unrecognized interpolation method"); + error ("interpn: unrecognized interpolation method"); endif endfunction
--- a/scripts/general/postpad.m +++ b/scripts/general/postpad.m @@ -59,7 +59,7 @@ endif if (! isscalar (l) || l < 0) - error ("second argument must be a positive scaler"); + error ("postpad: second argument must be a positive scaler"); endif if (dim > nd)
--- a/scripts/general/prepad.m +++ b/scripts/general/prepad.m @@ -70,7 +70,7 @@ endif if (! isscalar (l) || l < 0) - error ("second argument must be a positive scaler"); + error ("prepad: second argument must be a positive scaler"); endif if (dim > nd)
--- a/scripts/general/private/__splinen__.m +++ b/scripts/general/private/__splinen__.m @@ -27,13 +27,13 @@ function yi = __splinen__ (x, y, xi, extrapval, f) if (nargin != 5) - error ("Incorrect number of arguments"); + error ("__splinen__: Incorrect number of arguments"); endif ## ND isvector function. isvec = @(x) numel (x) == length (x); if (!iscell (x) || length(x) < ndims(y) || any (! cellfun (isvec, x)) || !iscell (xi) || length(xi) < ndims(y) || any (! cellfun (isvec, xi))) - error ("%s: non gridded data or dimensions inconsistent", f); + error ("__splinen__: %s: non gridded data or dimensions inconsistent", f); endif yi = y; for i = length(x):-1:1
--- a/scripts/image/image_viewer.m +++ b/scripts/image/image_viewer.m @@ -157,7 +157,7 @@ ## Did the system call fail? if (status != 0) - error ("the image viewing command failed"); + error ("image_viewer: the image viewing command failed"); endif endfunction
--- a/scripts/image/imagesc.m +++ b/scripts/image/imagesc.m @@ -115,7 +115,7 @@ if (length (limits) == 2 && limits(2) >= limits(1)) set (ax, "clim", limits); elseif (! isempty (limits)) - error ("expected data limits to be [lo, hi]"); + error ("imagesc: expected data limits to be [lo, hi]"); endif endfunction
--- a/scripts/image/saveimage.m +++ b/scripts/image/saveimage.m @@ -91,17 +91,17 @@ [map_nr, map_nc] = size (map); if (map_nc != 3) - error ("colormap should be an N x 3 matrix"); + error ("saveimage: colormap should be an N x 3 matrix"); endif if (nargin < 3) img_form = "img"; elseif (! ischar (img_form)) - error ("image format specification must be a string"); + error ("saveimage: image format specification must be a string"); elseif (! (strcmp (img_form, "img") || strcmp (img_form, "ppm") || strcmp (img_form, "ps"))) - error ("unsupported image format specification"); + error ("saveimage: unsupported image format specification"); endif if (! ismatrix (img)) @@ -109,7 +109,7 @@ endif if (! ischar (filename)) - error ("file name must be a string"); + error ("saveimage: file name must be a string"); endif ## If we just want Octave image format, save and return. @@ -224,7 +224,7 @@ elseif (strcmp (img_form, "ps") == 1) if (! grey) - error ("must have a greyscale color map for conversion to PostScript"); + error ("saveimage: must have a greyscale color map for conversion to PostScript"); endif bps = 8;
--- a/scripts/linear-algebra/expm.m +++ b/scripts/linear-algebra/expm.m @@ -92,7 +92,7 @@ function r = expm (a) if (! ismatrix (a) || ! issquare (a)) - error ("expm requires a square matrix"); + error ("expm: input must be a square matrix"); endif n = rows (a);
--- a/scripts/linear-algebra/krylov.m +++ b/scripts/linear-algebra/krylov.m @@ -82,13 +82,13 @@ endif if (! issquare (A) || isempty (A)) - error ("A(%d x %d) must be non-empty square matrix", rows (A), columns (A)); + error ("krylov: A(%d x %d) must be a non-empty square matrix", rows (A), columns (A)); endif na = rows (A); [m, kb] = size (V); if (m != na) - error("A(%d x %d), V(%d x %d): argument dimensions do not match", + error ("krylov: A(%d x %d), V(%d x %d): argument dimensions do not match", na, na, m, kb) endif @@ -185,7 +185,7 @@ krylov_V = V krylov_na = na krylov_length_alpha = length (alpha) - error ("This case should never happen; submit a bug report"); + error ("krylov: this case should never happen; submit a bug report"); endif if (columns (V) > 0)
--- a/scripts/miscellaneous/edit.m +++ b/scripts/miscellaneous/edit.m @@ -172,7 +172,7 @@ if (strcmp (state, "sync") || strcmp (state, "async")) FUNCTION.MODE = state; else - error('expected "edit MODE sync|async"'); + error('edit: expected "edit MODE sync|async"'); endif case "EDITINPLACE" if (ischar (state)) @@ -192,7 +192,7 @@ ret = FUNCTION; endif otherwise - error ("expected \"edit EDITOR|HOME|AUTHOR|EMAIL|LICENSE|MODE val\""); + error ('edit: expected "edit EDITOR|HOME|AUTHOR|EMAIL|LICENSE|MODE val"'); endswitch return endif @@ -212,7 +212,7 @@ ## Check whether the user is trying to edit a builtin of compiled function. switch (exist (file)) case {3, 5} - error ("unable to edit a built-in or compiled function"); + error ("edit: unable to edit a built-in or compiled function"); endswitch ## Checks for whether the file is
--- a/scripts/miscellaneous/private/__xzip__.m +++ b/scripts/miscellaneous/private/__xzip__.m @@ -90,7 +90,7 @@ entries = compressed_files; endif else - error ("%s command failed with exit status = %d", + error ("__xzip__: %s command failed with exit status = %d", commandname, status); endif unwind_protect_cleanup
--- a/scripts/miscellaneous/what.m +++ b/scripts/miscellaneous/what.m @@ -38,7 +38,7 @@ else [status, msg, msgid] = fileattrib (d); if (status != 1) - error ("could not find the file or path %s", d); + error ("what: could not find the file or path %s", d); else d = msg.Name; endif
--- a/scripts/optimization/glpk.m +++ b/scripts/optimization/glpk.m @@ -428,7 +428,7 @@ endif if (all (size (c) > 1) || iscomplex (c) || ischar (c)) - error ("C must be a real vector"); + error ("glpk:C must be a real vector"); return; endif nx = length (c); @@ -438,23 +438,23 @@ ## 2) Matrix constraint if (isempty (a)) - error ("A cannot be an empty matrix"); + error ("glpk: A cannot be an empty matrix"); return; endif [nc, nxa] = size(a); if (! isreal (a) || nxa != nx) - error ("A must be a real valued %d by %d matrix", nc, nx); + error ("glpk: A must be a real valued %d by %d matrix", nc, nx); return; endif ## 3) RHS if (isempty (b)) - error ("B cannot be an empty vector"); + error ("glpk: B cannot be an empty vector"); return; endif if (! isreal (b) || length (b) != nc) - error ("B must be a real valued %d by 1 vector", nc); + error ("glpk: B must be a real valued %d by 1 vector", nc); return; endif @@ -464,7 +464,7 @@ if (isempty (lb)) lb = zeros (nx, 1); elseif (! isreal (lb) || all (size (lb) > 1) || length (lb) != nx) - error ("LB must be a real valued %d by 1 column vector", nx); + error ("glpk: LB must be a real valued %d by 1 column vector", nx); return; endif else @@ -477,7 +477,7 @@ if (isempty (ub)) ub = Inf (nx, 1); elseif (! isreal (ub) || all (size (ub) > 1) || length (ub) != nx) - error ("UB must be a real valued %d by 1 column vector", nx); + error ("glpk: UB must be a real valued %d by 1 column vector", nx); return; endif else @@ -490,11 +490,11 @@ if (isempty (ctype)) ctype = repmat ("S", nc, 1); elseif (! ischar (ctype) || all (size (ctype) > 1) || length (ctype) != nc) - error ("CTYPE must be a char valued vector of length %d", nc); + error ("glpk: CTYPE must be a char valued vector of length %d", nc); return; elseif (! all (ctype == "F" | ctype == "U" | ctype == "S" | ctype == "L" | ctype == "D")) - error ("CTYPE must contain only F, U, S, L, or D"); + error ("glpk: CTYPE must contain only F, U, S, L, or D"); return; endif else @@ -508,10 +508,10 @@ vartype = repmat ("C", nx, 1); elseif (! ischar (vartype) || all (size (vartype) > 1) || length (vartype) != nx) - error ("VARTYPE must be a char valued vector of length %d", nx); + error ("glpk: VARTYPE must be a char valued vector of length %d", nx); return; elseif (! all (vartype == "C" | vartype == "I")) - error ("VARTYPE must contain only C or I"); + error ("glpk: VARTYPE must contain only C or I"); return; endif else @@ -525,7 +525,7 @@ if (isempty (sense)) sense = 1; elseif (ischar (sense) || all (size (sense) > 1) || ! isreal (sense)) - error ("SENSE must be an integer value"); + error ("glpk: SENSE must be an integer value"); elseif (sense >= 0) sense = 1; else @@ -539,7 +539,7 @@ if (nargin > 8) if (! isstruct (param)) - error ("PARAM must be a structure"); + error ("glpk: PARAM must be a structure"); return; endif else
--- a/scripts/optimization/optimset.m +++ b/scripts/optimization/optimset.m @@ -49,7 +49,7 @@ try retval = feval (fcn, 'defaults'); catch - error ("no defaults for function `%s'", fcn); + error ("optimset: no defaults for function `%s'", fcn); end_try_catch elseif (nargs == 2 && isstruct (varargin{1}) && isstruct (varargin{2})) ## Set slots in old from nonempties in new. Should we be checking
--- a/scripts/optimization/pqpnonneg.m +++ b/scripts/optimization/pqpnonneg.m @@ -76,7 +76,7 @@ m = rows (c); n = columns (c); if (m != n) - error ("matrix must be square"); + error ("pqpnonneg: matrix must be square"); endif if (isempty (x))
--- a/scripts/path/pathdef.m +++ b/scripts/path/pathdef.m @@ -113,7 +113,7 @@ unwind_protect_cleanup closeread = fclose (fid); if (closeread < 0) - error ("savepath: could not close savefile after reading, %s", + error ("__extractpath__: could not close savefile after reading, %s", savefile); endif end_unwind_protect @@ -121,7 +121,7 @@ ## Extract the path specifiation. if (startline > endline || (startline > 0 && endline == 0)) - error ("savepath: unable to parse file, %s", savefile); + error ("__extractpath__: unable to parse file, %s", savefile); elseif (startline > 0) ## Undo doubling of single quote characters performed by savepath. specifiedpath = strrep (regexprep (cstrcat (filelines(startline:endline){:}),
--- a/scripts/plot/__go_draw_axes__.m +++ b/scripts/plot/__go_draw_axes__.m @@ -518,7 +518,7 @@ endif if (nd == 3) if (numel (xcol) > 3) - error ("gnuplot (as of v4.2) only supports 3D filled triangular patches"); + error ("__go_draw_axes__: gnuplot (as of v4.2) only supports 3D filled triangular patches"); else if (isnan (data_3d_idx)) data_idx++; @@ -1979,7 +1979,7 @@ fprintf (plot_stream, "unset m%stics;\n", ax); endif else - error ("unsupported type of ticklabel"); + error ("__go_draw_axes__: unsupported type of ticklabel"); endif else fprintf (plot_stream, "set format %s \"%s\";\n", ax, fmt);
--- a/scripts/plot/__marching_cube__.m +++ b/scripts/plot/__marching_cube__.m @@ -96,19 +96,19 @@ if (!ismatrix (xx) || !ismatrix (yy) || !ismatrix (zz) || !ismatrix (c) || ... ndims (xx) != 3 || ndims (yy) != 3 || ndims (zz) != 3 || ndims (c) != 3) - error ("xx, yy, zz, c have to be matrizes of dim 3"); + error ("__marching_cube__: xx, yy, zz, c have to be matrizes of dim 3"); endif if (!size_equal (xx, yy, zz, c)) - error ("xx, yy, zz, c are not the same size"); + error ("__marching_cube__: xx, yy, zz, c are not the same size"); endif if (any (size (xx) < [2 2 2])) - error ("grid size has to be at least 2x2x2"); + error ("__marching_cube__: grid size has to be at least 2x2x2"); endif if (!isscalar (iso)) - error ("iso needs to be scalar value"); + error ("__marching_cube__: iso needs to be scalar value"); endif if (nargin == 6) @@ -209,7 +209,7 @@ elseif (nargin == 11) p = zeros (length (p1x), 4); else - error ("Wrong number of arguments"); + error ("__marching_cube__: wrong number of arguments"); endif mu = zeros (length (p1x), 1); id = abs (valp1-valp2) < (10*eps) .* (abs (valp1) .+ abs (valp2));
--- a/scripts/plot/gnuplot_drawnow.m +++ b/scripts/plot/gnuplot_drawnow.m @@ -224,7 +224,7 @@ endif [begin_match, end_match, te, match] = regexp (opts_str, "(\\s-r\\d+)|(^-r\\d+)"); if (! isempty (begin_match)) - error ("gnuplot_drawnow.m: specifying resultion, '%s', not supported for terminal '%s'", + error ("gnuplot_drawnow: specifying resultion, '%s', not supported for terminal '%s'", strtrim (match{1}), term) endif if (all (gnuplot_size > 0))
--- a/scripts/plot/ishold.m +++ b/scripts/plot/ishold.m @@ -40,10 +40,10 @@ ax = h; fig = get (h, "parent"); else - error ("hold: expecting argument to be axes or figure graphics handle"); + error ("ishold: expecting argument to be axes or figure graphics handle"); endif else - error ("hold: expecting argument to be axes or figure graphics handle"); + error ("ishold: expecting argument to be axes or figure graphics handle"); endif else print_usage ();
--- a/scripts/plot/isocolors.m +++ b/scripts/plot/isocolors.m @@ -137,7 +137,7 @@ pa = vp; v = get (pa, "Vertices"); else - error("Last argument is no vertex list and no patch handle"); + error("isocolors: last argument is not a vertex list or patch handle"); endif if ( calc_rgb ) new_col = zeros (size (v, 1), 3);
--- a/scripts/plot/isonormals.m +++ b/scripts/plot/isonormals.m @@ -98,7 +98,7 @@ if (strcmp (lower (varargin{nargin}), "negate")) negate = true; else - error ("Unknown option '%s'", varargin{nargin}); + error ("isonormals: Unknown option '%s'", varargin{nargin}); endif endif switch na @@ -124,7 +124,7 @@ pa = vp; v = get (pa, "Vertices"); else - error ("Last argument is no vertex list and no patch handle"); + error ("isonormals: Last argument is not a vertex list or a patch handle"); endif if (negate) normals = -__interp_cube__ (x, y, z, c, v, "normals");
--- a/scripts/plot/print.m +++ b/scripts/plot/print.m @@ -256,7 +256,7 @@ ghostscript_binary = file_in_path (EXEC_PATH, ghostscript_binary); endif if (isempty (ghostscript_binary)) - error ("print.m: Ghostscript binary ""%s"" could not be located", arg(3:end)) + error ("print: Ghostscript binary ""%s"" could not be located", arg(3:end)) endif elseif (length (arg) > 2 && arg(1:2) == "-F") idx = rindex (arg, ":"); @@ -703,7 +703,7 @@ status1 = system (command); status2 = system (sprintf ("mv %s %s", temp_name, appended_file_name)); if (status1 != 0 || status2 != 0) - error ("print.m: output failed to append to '%s'.", appended_file_name); + error ("print: output failed to append to '%s'.", appended_file_name); endif endif unwind_protect_cleanup
--- a/scripts/plot/private/__add_datasource__.m +++ b/scripts/plot/private/__add_datasource__.m @@ -24,7 +24,7 @@ function newargs = __add_datasource__ (fcn, h, data, varargin) if (nargin < 3) - error ("internal error"); + error ("__add_datasource__: a minimum of 3 inputs are required"); endif if (ischar (data))
--- a/scripts/plot/private/__color_str_rgb__.m +++ b/scripts/plot/private/__color_str_rgb__.m @@ -45,6 +45,6 @@ rgb = [0, 0, 0]; endif else - error ("expecting a string argument"); + error ("__color_str_rgb__: expecting a string argument"); endif endfunction
--- a/scripts/plot/private/__errplot__.m +++ b/scripts/plot/private/__errplot__.m @@ -87,7 +87,7 @@ xldata = []; xudata = []; else - error ("2 column errorplot is only valid or xerr or yerr"); + error ("errorbar: 2 column errorplot is only valid or xerr or yerr"); endif case 3 if (strcmp (ifmt, "boxxy") || strcmp (ifmt, "xyerr")) @@ -144,10 +144,10 @@ ldata = varargin{5}(:,i); udata = varargin{6}(:,i); else - error ("error plot with 6 columns only valid for boxxy and xyerr"); + error ("errorbar: error plot with 6 columns only valid for boxxy and xyerr"); endif otherwise - error ("error plot requires 2, 3, 4 or 6 arguments."); + error ("errorbar: error plot requires 2, 3, 4 or 6 arguments."); endswitch addproperty ("xdata", hg, "data", xdata(:)) @@ -258,7 +258,7 @@ ydata = [y1; y2]; return else - error ("valid error bar types are xerr, yerr, boxxy, and xyerr.") + error ("errorbar: valid error bar types are xerr, yerr, boxxy, and xyerr.") endif xdata = xdata.'(:); ydata = ydata.'(:);
--- a/scripts/plot/private/__interp_cube__.m +++ b/scripts/plot/private/__interp_cube__.m @@ -31,16 +31,16 @@ y = y(:); z = z(:); else - error("x, y, z have wrong dimensions"); + error("__interp_cube__: x, y, z have wrong dimensions"); endif if (size (val) != [length(x), length(y), length(z)]) - error ("val has wrong dimensions"); + error ("__interp_cube__: val has wrong dimensions"); endif if (size (v, 2) != 3) error ( "v has to be N*3 matrix"); endif if (!ischar (req)) - error ("Invalid request parameter use 'values', 'normals' or 'normals8'"); + error ("__interp_cube__: Invalid request parameter use 'values', 'normals' or 'normals8'"); endif if (isempty (v)) Vxyz = idx = frac = []; @@ -94,7 +94,7 @@ [Dx, Dy, Dz, idx, frac] = interp_cube_trilin_grad (x, y, z, val, v); Vxyz = [Dx./dx, Dy./dy, Dz./dz]; otherwise - error ("Invalid request type '%s', use 'values', 'normals' or 'normals8'", req); + error ("__interp_cube__: Invalid request type '%s', use 'values', 'normals' or 'normals8'", req); endswitch endfunction @@ -178,4 +178,4 @@ idx(:, 3) = lookup (z(2:end-1), v(:, 3)) + 1; frac(:, 3) = (v(:, 3) - z(idx(:, 3))) ... ./ (z(idx(:, 3)+1) - z(idx(:, 3))); -endfunction \ No newline at end of file +endfunction
--- a/scripts/plot/shading.m +++ b/scripts/plot/shading.m @@ -67,7 +67,7 @@ set (h, "facecolor", "flat"); set (h, "edgecolor", [0 0 0]); else - error ("unknown argument"); + error ("shading: unknown argument"); endif endfor
--- a/scripts/plot/specular.m +++ b/scripts/plot/specular.m @@ -58,7 +58,7 @@ ## Check for view vector (vv) argument. if (length (vv) < 2 || length (lv) > 3) - error ("view vector VV must be a 2- or 3-element vector"); + error ("specular: view vector VV must be a 2- or 3-element vector"); elseif (length (vv) == 2) [vv(1), vv(2), vv(3)] = sph2cart (vv(1) * pi / 180, vv(2) * pi / 180, 1.0); endif
--- a/scripts/polynomial/deconv.m +++ b/scripts/polynomial/deconv.m @@ -41,7 +41,7 @@ endif if (! (isvector (y) && isvector (a))) - error("conv: both arguments must be vectors"); + error("deconv: both arguments must be vectors"); endif la = length (a);
--- a/scripts/polynomial/polyint.m +++ b/scripts/polynomial/polyint.m @@ -42,7 +42,7 @@ endif if (! (isvector (p) || isempty (p))) - error ("argument must be a vector"); + error ("polyint: argument must be a vector"); endif lp = length (p);
--- a/scripts/polynomial/ppint.m +++ b/scripts/polynomial/ppint.m @@ -28,7 +28,7 @@ print_usage (); endif if (! isstruct (pp)) - error ("ppder: expects a pp structure"); + error ("ppint: expects a pp structure"); endif [x, p, n, k, d] = unmkpp (pp);
--- a/scripts/set/powerset.m +++ b/scripts/set/powerset.m @@ -31,9 +31,9 @@ if (nargin == 2) if (! strcmpi (byrows_arg, "rows")) - error ("expecting third argument to be \"rows\""); + error ('powerset: expecting third argument to be "rows"'); elseif (iscell (a)) - warning ("setdiff: \"rows\" not valid for cell arrays"); + warning ('powerset: "rows" not valid for cell arrays'); else byrows = true; endif
--- a/scripts/signal/arch_fit.m +++ b/scripts/signal/arch_fit.m @@ -58,7 +58,7 @@ endif if (! (isvector (y))) - error ("arch_test: y must be a vector"); + error ("arch_fit: y must be a vector"); endif T = length (y); @@ -67,7 +67,7 @@ if ((rx == 1) && (cx == 1)) X = autoreg_matrix (y, X); elseif (! (rx == T)) - error ("arch_test: either rows (X) == length (y), or X is a scalar"); + error ("arch_fit: either rows (X) == length (y), or X is a scalar"); endif [T, k] = size (X);
--- a/scripts/signal/arch_test.m +++ b/scripts/signal/arch_test.m @@ -69,7 +69,7 @@ function [pval, lm] = arch_test (y, X, p) if (nargin != 3) - error ("arch_test needs 3 input arguments"); + error ("arch_test: 3 input arguments required"); endif if (! (isvector (y))) @@ -94,4 +94,4 @@ lm = f' * inv (Z'*Z) * f / 2; pval = 1 - chisquare_cdf (lm, p); -endfunction \ No newline at end of file +endfunction
--- a/scripts/signal/durbinlevinson.m +++ b/scripts/signal/durbinlevinson.m @@ -51,7 +51,7 @@ t = length (oldphi) + 1; if (length (c) < t+1) - error ("durbilevinson: c too small"); + error ("durbinlevinson: c too small"); endif if (oldv == 0)
--- a/scripts/special-matrix/hadamard.m +++ b/scripts/special-matrix/hadamard.m @@ -89,7 +89,7 @@ case 7 h = hnormalize (h28 ()); otherwise - error ("n must be 2^k*p, for p = 1, 12, 20 or 28"); + error ("hadamard: n must be 2^k*p, for p = 1, 12, 20 or 28"); endswitch ## Build H(2^k*n) from kron(H(2^k),H(n)).
--- a/scripts/statistics/distributions/unidrnd.m +++ b/scripts/statistics/distributions/unidrnd.m @@ -49,7 +49,7 @@ endfor dims = [varargin{:}]; else - error ("unidrnd (n, ...)"); + error ("unidrnd: Usage unirnd (n, ...)"); endif if (isscalar (n) || (length (size (n)) == length (dims) && all (size (n) == dims)))
--- a/scripts/statistics/distributions/unifinv.m +++ b/scripts/statistics/distributions/unifinv.m @@ -41,7 +41,7 @@ if (!isscalar (a) || !isscalar(b)) [retval, x, a, b] = common_size (x, a, b); if (retval > 0) - error ("uniform_cdf: x, a and b must be of common size or scalar"); + error ("unifinv: x, a and b must be of common size or scalar"); endif endif
--- a/scripts/statistics/models/logistic_regression.m +++ b/scripts/statistics/models/logistic_regression.m @@ -96,7 +96,7 @@ endif; [mx, nx] = size (x); if (mx != my) - error ("x and y must have the same number of observations"); + error ("logistic_regression: x and y must have the same number of observations"); endif ## initial calculations @@ -141,7 +141,7 @@ while ((dev - devold) / (dl' * (tb - tbold)) > 0) epsilon = epsilon * incr; if (epsilon > 1e+15) - error ("epsilon too large"); + error ("logistic_regression: epsilon too large"); endif tb = tbold - (d2l - epsilon * eye (size (d2l))) \ dl; [g, g1, p, dev] = logistic_regression_likelihood (y, x, tb, z, z1);
--- a/scripts/strings/strjust.m +++ b/scripts/strings/strjust.m @@ -49,7 +49,7 @@ endif if (ndims (x) != 2) - error ("needs a string or character matrix"); + error ("strjust: input must be a string or character matrix"); endif if (isempty (x))
--- a/scripts/testfun/rundemos.m +++ b/scripts/testfun/rundemos.m @@ -68,7 +68,7 @@ function retval = has_demos (f) fid = fopen (f); if (f < 0) - error ("fopen failed: %s", f); + error ("rundemos: fopen failed: %s", f); else str = fscanf (fid, "%s"); fclose (fid);
--- a/scripts/testfun/runtests.m +++ b/scripts/testfun/runtests.m @@ -87,7 +87,7 @@ endwhile fclose (fid); else - error ("fopen failed: %s", f); + error ("runtests: fopen failed: %s", f); endif endfunction
--- a/scripts/testfun/test.m +++ b/scripts/testfun/test.m @@ -105,7 +105,7 @@ if (ischar (__fid)) __fid = fopen (__fid, "wt"); if (__fid < 0) - error ("could not open log file"); + error ("test: could not open log file"); endif __close_fid = 1; endif @@ -149,7 +149,7 @@ endif return; else - error ("test unknown flag '%s'", __flag); + error ("test: unknown flag '%s'", __flag); endif ## Locate the file to test.
--- a/scripts/time/datenum.m +++ b/scripts/time/datenum.m @@ -80,7 +80,7 @@ if (nargin == 1) nc = columns (Y); if (nc > 6 || nc < 3) - error ("expected date vector containing [Y, M, D, h, m, s]"); + error ("datenum: expected date vector containing [Y, M, D, h, m, s]"); endif s = m = h = 0; if (nc >= 6) s = Y(:,6); endif