octave-maintainers
[Top][All Lists]

## Documentation patch to Octave polyval.m

 From: Muthiah Annamalai Subject: Documentation patch to Octave polyval.m Date: Sun, 22 Oct 2006 03:42:49 -0500

```Hello there,
I think the ./scripts/polynomial/ could use some documentation
about the order of polynomial coefficients we expect (out of )
or as input to various functions.

I just added some (hopefully useful) documentation on this to
the polyval.m

Cheers
Muthu

Index: polyval.m
===================================================================
RCS file: /cvs/octave/scripts/polynomial/polyval.m,v
retrieving revision 1.23
diff -u -r1.23 polyval.m
--- polyval.m   10 Oct 2006 16:10:28 -0000      1.23
+++ polyval.m   22 Oct 2006 08:36:29 -0000
@@ -22,13 +22,24 @@
## Evaluate a polynomial.
##
## @code{polyval (@var{c}, @var{x})} will evaluate the polynomial at the
-## specified value of @var{x}.
+## specified value of @var{x}. The polynomial is represented by @var{c}
+## as a polynomial coefficient array given from highest degree coefficient
+## to the lowest degree coefficient.
##
## If @var{x} is a vector or matrix, the polynomial is evaluated at each of
## the elements of @var{x}.
## @seealso{polyvalm, poly, roots, conv, deconv, residue, filter,
## polyderiv, polyinteg}
## @end deftypefn
+##
+## @group
+## @example
+## To evaluate the polynomial [1*x*x + 2*x + 3], at x=4, we can
+## use the polyval function as,
+## polyval([1 2 3],4), returns the value
+## ans = 27
+## @end example
+## @end group