Mercurial > hg > octave-nkf
diff scripts/general/logspace.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 | 81d6ab3ac93c |
line wrap: on
line diff
--- a/scripts/general/logspace.m +++ b/scripts/general/logspace.m @@ -92,3 +92,20 @@ endif endfunction + +%!test +%! x1 = logspace (1, 2); +%! x2 = logspace (1, 2, 10); +%! x3 = logspace (1, -2, 10); +%! x4 = logspace (1, pi, 10); +%! assert((size (x1) == [1, 50] && x1(1) == 10 && x1(50) == 100 +%! && size (x2) == [1, 10] && x2(1) == 10 && x2(10) == 100 +%! && size (x3) == [1, 10] && x3(1) == 10 && x3(10) == 0.01 +%! && size (x4) == [1, 10] && x4(1) == 10 && abs (x4(10) - pi) < sqrt (eps))); + +%!error logspace ([1, 2; 3, 4], 5, 6); + +%!error logspace (); + +%!error logspace (1, 2, 3, 4); +