diff scripts/general/shift.m @ 3238:041ea33fbbf4

[project @ 1999-03-26 17:48:16 by jwe]
author jwe
date Fri, 26 Mar 1999 17:48:35 +0000
parents 1dca28c213f0
children 7d80b56e0dc8
line wrap: on
line diff
--- a/scripts/general/shift.m
+++ b/scripts/general/shift.m
@@ -31,7 +31,7 @@
     error ("usage: shift (X, b)");
   endif
 
-  [nr nc] = size (x);
+  [nr, nc] = size (x);
   
   if (nr == 0 || nc == 0)
     error ("shift: x must not be empty");
@@ -47,10 +47,14 @@
 
   if (b >= 0)
     b = rem (b, nr);
-    y = [x (nr - b + 1 : nr, :); x (1 : nr - b, :)];
+    t1 = x (nr-b+1:nr, :);
+    t2 = x (1:nr-b, :);
+    y = [t1; t2];
   elseif (b < 0)
     b = rem (abs (b), nr);
-    y = [x (b + 1 : nr, :); x (1 : b, :)];
+    t1 = x (b+1:nr, :)
+    t2 = x (1:b, :);
+    y = [t1; t2];
   endif
 
   if (nc == 0)