Mercurial > hg > octave-avbm
changeset 2667:1d2a83e8a9a3
[project @ 1997-02-10 04:06:55 by jwe]
author | jwe |
---|---|
date | Mon, 10 Feb 1997 04:07:08 +0000 |
parents | aa519c3a0523 |
children | 0d865ef7478f |
files | scripts/ChangeLog scripts/general/is_matrix.m scripts/general/is_vector.m scripts/general/isempty.m scripts/plot/contour.m |
diffstat | 5 files changed, 22 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,15 @@ +Sun Feb 9 19:52:08 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + + * general/is_matrix.m: Scalars, vectors, and empty matrices may + also be considered to be matrices. + + * general/is_vector.m: Scalars may also be considered to be vectors. + + * general/isempty.m: Use size(), not rows() and columns(). + + * plot/contour.m: Convert set to gset. + Set view to 0, 0, 1, 1, not 0, 0, 1.9, 1. + Fri Feb 7 12:55:55 1997 John W. Eaton <jwe@bevo.che.wisc.edu> * specfun/erfinv.m: Fix typo in last change.
--- a/scripts/general/is_matrix.m +++ b/scripts/general/is_matrix.m @@ -19,8 +19,7 @@ ## usage: is_matrix (x) ## -## Return 1 if the number of rows and columns of x are both greater -## than 1. +## Return 1 if X is a matrix. Otherwise, return 0. ## ## See also: size, rows, columns, length, is_scalar, is_vector @@ -30,7 +29,7 @@ if (nargin == 1) [nr, nc] = size (x); - retval = (nr > 1 && nc > 1); + retval = (nr >= 0 && nc >= 0); else usage ("is_matrix (x)"); endif
--- a/scripts/general/is_vector.m +++ b/scripts/general/is_vector.m @@ -19,8 +19,7 @@ ## usage: is_vector (x) ## -## Return 1 if the either the number of rows (columns) of x is 1 and -## the number of columns (rows) is greater than one. Otherwise, return 0. +## Return 1 if X is a vector. Otherwise, return 0. ## ## See also: size, rows, columns, length, is_scalar, is_matrix @@ -30,7 +29,7 @@ if (nargin == 1) [nr, nc] = size (x); - retval = ((nr == 1 && nc > 1) || (nc == 1 && nr > 1)); + retval = ((nr == 1 && nc >= 1) || (nc == 1 && nr >= 1)); else usage ("is_vector (x)"); endif
--- a/scripts/general/isempty.m +++ b/scripts/general/isempty.m @@ -29,6 +29,8 @@ usage ("isempty (var)"); endif - retval = (rows (var) == 0 || columns (var) == 0); + [nr, nc] = size (var); + + retval = (nr == 0 || nc == 0); endfunction
--- a/scripts/plot/contour.m +++ b/scripts/plot/contour.m @@ -39,7 +39,7 @@ command = sprintf ("gset cntrparam levels %d", n); eval (command); gset noparametric; - gset view 0, 0, 1.9, 1; + gset view 0, 0, 1, 1; gsplot z w l 1; else error ("mesh: argument must be a matrix"); @@ -64,10 +64,10 @@ gset nosurface; gset contour; gset cntrparam bspline; - command = sprintf ("set cntrparam levels %d", n); + command = sprintf ("gset cntrparam levels %d", n); eval (command); gset parametric; - gset view 0, 0, 1.9, 1; + gset view 0, 0, 1, 1; gsplot zz w l 1; else msg = "mesh: rows (z) must be the same as length (x) and";