# HG changeset patch # User Rik # Date 1411268370 25200 # Node ID 3132cd3d6625eb756a940ea8ba0cca2a1421926b # Parent c53401edf4e3483a40a9609e88d7f15ef564b14a repmat.m: Use Octave coding conventions in cset c53401edf4e3. repmat.m: Use Octave coding conventions in cset c53401edf4e3. diff -r c53401edf4e3 -r 3132cd3d6625 scripts/general/repmat.m --- 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