Mercurial > hg > octave-nkf
diff examples/@polynomial/polynomial.m @ 9284:567e3e4ab74d
fix up examples/@polynomial
author | Robert T. Short <octave@phaselockedsystems.com> |
---|---|
date | Sun, 31 May 2009 21:11:31 -0700 |
parents | e07e93c04080 |
children | 050bc580cb60 |
line wrap: on
line diff
--- a/examples/@polynomial/polynomial.m +++ b/examples/@polynomial/polynomial.m @@ -6,23 +6,24 @@ ## @example ## a0 + a1 * x + a2 * x^2 + @dots{} + an * x^n ## @end example +## +## from a vector of coefficients [a0 a1 a2 ... an]. ## @end deftypefn function p = polynomial (a) if (nargin == 0) - p.poly = []; + p.poly = [0]; p = class (p, "polynomial"); elseif (nargin == 1) if (strcmp (class (a), "polynomial")) p = a; elseif (isvector (a) && isreal (a)) - p.poly = a(:)'; + p.poly = a(:).'; p = class (p, "polynomial"); else - error ("polynomial: expecting real or complex vector"); + error ("polynomial: expecting real vector"); endif else print_usage (); endif - superiorto ("double"); endfunction