Mercurial > hg > octave-nkf
diff scripts/general/shiftdim.m @ 4895:9df0048ae0a1
[project @ 2004-06-03 19:34:07 by jwe]
author | jwe |
---|---|
date | Thu, 03 Jun 2004 19:34:07 +0000 |
parents | ab5870f984d9 |
children | c08cb1098afc |
line wrap: on
line diff
--- a/scripts/general/shiftdim.m +++ b/scripts/general/shiftdim.m @@ -51,7 +51,7 @@ function [y, ns] = shiftdim (x, n) if (nargin == 1) - ## Find the first singleton dimension + ## Find the first singleton dimension. nd = ndims (x); orig_dims = size (x); ns = 1; @@ -61,10 +61,10 @@ if (ns > nd) ns = 1; endif - y = reshape (x, orig_dims ([ns:end])); + y = reshape (x, orig_dims(ns:end)); ns = ns - 1; elseif (nargin == 2) - if (!isscalar(n) && floor(n) != n) + if (! isscalar (n) && floor (n) != n) error ("shiftdim: n must be an scalar integer"); endif if (n < 0)