Mercurial > hg > octave-lyh
diff scripts/general/rot90.m @ 7411:83a8781b529d
[project @ 2008-01-22 21:52:25 by jwe]
author | jwe |
---|---|
date | Tue, 22 Jan 2008 21:52:26 +0000 |
parents | a1dbe9d80eee |
children | e07e93c04080 |
line wrap: on
line diff
--- a/scripts/general/rot90.m +++ b/scripts/general/rot90.m @@ -90,3 +90,21 @@ endif endfunction + +%!test +%! x1 = [1, 2; +%! 3, 4]; +%! x2 = [2, 4; +%! 1, 3]; +%! x3 = [4, 3; +%! 2, 1]; +%! x4 = [3, 1; +%! 4, 2]; +%! +%! assert((rot90 (x1)== x2 && rot90 (x1, 2) == x3 && rot90 (x1, 3) == x4 +%! && rot90 (x1, 4) == x1 && rot90 (x1, 5) == x2 && rot90 (x1, -1) == x4)); + +%!error rot90 (); + +%!error rot90 (1, 2, 3); +