Mercurial > hg > octave-nkf
diff scripts/polynomial/polyreduce.m @ 11469:c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 09 Jan 2011 12:41:21 -0800 |
parents | f6e0404421f4 |
children | fd0a3ac60b0e |
line wrap: on
line diff
--- a/scripts/polynomial/polyreduce.m +++ b/scripts/polynomial/polyreduce.m @@ -29,19 +29,19 @@ ## Created: June 1994 ## Adapted-By: jwe -function p = polyreduce (p) +function p = polyreduce (c) if (nargin != 1) print_usage (); endif - if (! (isvector (p) || isempty (p))) - error ("polyreduce: argument must be a vector"); + if (!isvector (c) || isempty (c)) + error ("polyreduce: C must be a non-empty vector"); endif - if (! isempty (p)) + if (! isempty (c)) - index = find (p != 0); + index = find (c != 0); if (isempty (index)) @@ -49,7 +49,7 @@ else - p = p (index (1):length (p)); + p = c(index (1):length (c)); endif @@ -63,7 +63,5 @@ %!assert(all (all (polyreduce ([1, 0, 3]) == [1, 0, 3]))); -%!assert(isempty (polyreduce ([]))); - %!error polyreduce ([1, 2; 3, 4]);