Mercurial > hg > octave-lyh
diff scripts/general/randperm.m @ 5500:709307492cd7
[project @ 2005-10-18 19:18:21 by jwe]
author | jwe |
---|---|
date | Tue, 18 Oct 2005 19:18:22 +0000 |
parents | 4c8a2e4e0717 |
children | 34f96dd5441b |
line wrap: on
line diff
--- a/scripts/general/randperm.m +++ b/scripts/general/randperm.m @@ -29,10 +29,10 @@ function retval = randperm (n) if (nargin == 1 && isscalar (n) && floor (n) == n) - if (n > 0) + if (n >= 0) [junk, retval] = sort (rand (1, n)); else - error ("randperm: argument must be positive"); + error ("randperm: argument must be non-negative"); endif else usage ("randperm (n)");