Mercurial > hg > octave-nkf
changeset 5135:8eaef366ab43
[project @ 2005-02-09 07:59:37 by jwe]
author | jwe |
---|---|
date | Wed, 09 Feb 2005 07:59:37 +0000 |
parents | 0309b6722ee9 |
children | 100f9c190be4 |
files | scripts/ChangeLog scripts/polynomial/polyderiv.m |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2005-02-09 John W. Eaton <jwe@octave.org> + + * polynomial/polyderiv.m: Force P to be a row vector. + 2005-02-08 John W. Eaton <jwe@octave.org> * strings/dec2base.m: Don't delete leading zero if third arg is
--- a/scripts/polynomial/polyderiv.m +++ b/scripts/polynomial/polyderiv.m @@ -40,7 +40,7 @@ error ("polyderiv: argument must be a vector"); endif - lp = length (p); + lp = numel (p); if (lp == 1) q = 0; return; @@ -49,6 +49,9 @@ return; end - q = p (1:(lp-1)) .* [(lp-1):-1:1]; + ## Force P to be a row vector. + p = p(:).'; + + q = p(1:(lp-1)) .* [(lp-1):-1:1]; endfunction