# HG changeset patch # User jwe # Date 1017771948 0 # Node ID c8c1ead8474f966d4bf2b2e466bcf1ad5d05a177 # Parent c34d631dee186f28c7c73a143e2a5a0109eb75d7 [project @ 2002-04-02 18:25:48 by jwe] diff -r c34d631dee18 -r c8c1ead8474f scripts/ChangeLog --- a/scripts/ChangeLog Tue Apr 02 16:22:18 2002 +0000 +++ b/scripts/ChangeLog Tue Apr 02 18:25:48 2002 +0000 @@ -1,3 +1,13 @@ +2002-04-02 Paul Kienzle + + * plot/contour.m: Set default number of levels for contour(x,y,z). + + * control/system/starp.m: Leave more of the documentation + processing to texinfo and less to the @format block. + + * image/imagesc.m: Only display image if no output is requested. + Code tidying. + 2002-03-07 Paul Kienzle * statistics/base/center.m: Accept and return empty matrix. diff -r c34d631dee18 -r c8c1ead8474f scripts/control/system/starp.m --- a/scripts/control/system/starp.m Tue Apr 02 16:22:18 2002 +0000 +++ b/scripts/control/system/starp.m Tue Apr 02 18:25:48 2002 +0000 @@ -17,11 +17,9 @@ ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. ## -*- texinfo -*- -## @deftypefn {Function File} {} starp (@var{inputs}) +## @deftypefn {Function File} {} starp (@var{P}, @var{K}, @var{ny}, @var{nu}) ## @format ## -## sys = starp(P, K, ny, nu) -## ## Redheffer star product or upper/lower LFT, respectively. ## ## diff -r c34d631dee18 -r c8c1ead8474f scripts/image/imagesc.m --- a/scripts/image/imagesc.m Tue Apr 02 16:22:18 2002 +0000 +++ b/scripts/image/imagesc.m Tue Apr 02 18:25:48 2002 +0000 @@ -34,7 +34,7 @@ ## Created: July 1994 ## Adapted-By: jwe -function B = imagesc (x, y, A, zoom) +function ret = imagesc (x, y, A, zoom) if (nargin < 1 || nargin > 4) usage ("imagesc (matrix, zoom) or imagesc (x, y, matrix, zoom)"); @@ -50,21 +50,20 @@ zoom = []; endif - [high, wide] = size (A); - - maxval = max (max (A)); - minval = min (min (A)); - - ## Rescale matrix so that all values are in the range 0 to - ## length (colormap) inclusive. + maxval = max (A(:)); + minval = min (A(:)); if (maxval == minval) - B = ones (high, wide); + B = ones (size (A)); else ## Rescale values to between 1 and length (colormap) inclusive. B = round ((A - minval) / (maxval - minval) * (rows (colormap) - 1)) + 1; endif - image (x, y, B, zoom); + if (nargout == 0) + image (x, y, B, zoom); + else + ret = B; + endif endfunction diff -r c34d631dee18 -r c8c1ead8474f scripts/plot/contour.m --- a/scripts/plot/contour.m Tue Apr 02 16:22:18 2002 +0000 +++ b/scripts/plot/contour.m Tue Apr 02 18:25:48 2002 +0000 @@ -62,7 +62,10 @@ else error ("contour: argument must be a matrix"); endif - elseif (nargin == 4) + elseif (nargin == 3 || nargin == 4) + if (nargin == 3) + n = 10; + endif if (is_vector (x) && is_vector (y) && is_matrix (z)) xlen = length (x); ylen = length (y); @@ -104,7 +107,7 @@ error ("contour: x and y must be vectors and z must be a matrix"); endif else - usage ("contour (z, levels, x, y)"); + usage ("contour (z, x, y, levels)"); endif endfunction