Mercurial > octave-antonio
changeset 19115:3132cd3d6625
repmat.m: Use Octave coding conventions in cset c53401edf4e3.
repmat.m: Use Octave coding conventions in cset c53401edf4e3.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 20 Sep 2014 19:59:30 -0700 |
parents | c53401edf4e3 |
children | d657ed3f5f25 |
files | scripts/general/repmat.m |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/general/repmat.m Sun Sep 21 00:11:43 2014 +0200 +++ b/scripts/general/repmat.m Sat Sep 20 19:59:30 2014 -0700 @@ -67,20 +67,20 @@ n = n(:).'; endif else - if nargin > 3 + if (nargin > 3) # input check for m and varargin - if isscalar(m) && all(cellfun(@(x) isscalar(x), varargin)) + if (isscalar (m) && all (cellfun ("numel", varargin) == 1)) m = [m varargin{:}]; n = []; else - error("repmat: All input arguments have to be scalar") + error ("repmat: all input arguments must be scalar"); end elseif (isempty (m)) m = n = 1; elseif (isscalar (m)) n = m; elseif (ndims (m) > 2) - error ("repmat: M has more than 2 dimensions") + error ("repmat: M has more than 2 dimensions"); elseif (all (size (m) > 1)) m = m(:,1).'; n = []; @@ -92,7 +92,7 @@ idx = [m, n]; if (all (idx < 0)) - error ("repmat: invalid dimensions") + error ("repmat: invalid dimensions"); else idx = max (idx, 0); endif @@ -161,7 +161,7 @@ %!assert (repmat (x, [1 3]), repmat (x, 1, 3)) %!assert (repmat (x, [3 1]), repmat (x, 3, 1)) %!assert (repmat (x, [3 3]), repmat (x, 3, 3)) -%!assert (repmat (pi, [1,2,3,4]), repmat(pi,1,2,3,4)) +%!assert (repmat (pi, [1,2,3,4]), repmat (pi, 1,2,3,4)) # Tests for numel==1 case: %!shared x, r