Mercurial > hg > octave-nkf
changeset 5500:709307492cd7
[project @ 2005-10-18 19:18:21 by jwe]
author | jwe |
---|---|
date | Tue, 18 Oct 2005 19:18:22 +0000 |
parents | 9e3efbc3070a |
children | f2b9aa13f2bf |
files | scripts/ChangeLog scripts/general/randperm.m src/ChangeLog src/DLD-FUNCTIONS/gplot.l |
diffstat | 4 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2005-10-18 Keith Goodman <kwgoodman@gmail.com> + + * general/randperm.m: Improve compatibility by allowing input + value of zero. + 2005-10-13 John W. Eaton <jwe@octave.org> * plot/__plt__.m, plot/__errplot__.m, plot/replot.m:
--- 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)");