Mercurial > hg > octave-lyh
comparison scripts/polynomial/polyval.m @ 2311:2b5788792cad
[project @ 1996-07-11 20:18:38 by jwe]
author | jwe |
---|---|
date | Thu, 11 Jul 1996 20:18:38 +0000 |
parents | 5cffc4b8de57 |
children | 204cc7db6f4a |
comparison
equal
deleted
inserted
replaced
2310:e2a8f216373d | 2311:2b5788792cad |
---|---|
15 ### You should have received a copy of the GNU General Public License | 15 ### You should have received a copy of the GNU General Public License |
16 ### along with Octave; see the file COPYING. If not, write to the Free | 16 ### along with Octave; see the file COPYING. If not, write to the Free |
17 ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA | 17 ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
18 ### 02111-1307, USA. | 18 ### 02111-1307, USA. |
19 | 19 |
20 ## usage: polyval (c, x) | |
21 ## | |
22 ## Evaluate a polynomial. | |
23 ## | |
24 ## In octave, a polynomial is represented by it's coefficients (arranged | |
25 ## in descending order). For example a vector c of length n+1 corresponds | |
26 ## to the following nth order polynomial | |
27 ## | |
28 ## p(x) = c(1) x^n + ... + c(n) x + c(n+1). | |
29 ## | |
30 ## polyval(c,x) will evaluate the polynomial at the specified value of x. | |
31 ## | |
32 ## If x is a vector or matrix, the polynomial is evaluated at each of the | |
33 ## elements of x. | |
34 ## | |
35 ## SEE ALSO: polyvalm, poly, roots, conv, deconv, residue, filter, | |
36 ## polyderiv, polyinteg | |
37 | |
20 function y = polyval (c, x) | 38 function y = polyval (c, x) |
21 | |
22 ## usage: polyval (c, x) | |
23 ## | |
24 ## Evaluate a polynomial. | |
25 ## | |
26 ## In octave, a polynomial is represented by it's coefficients (arranged | |
27 ## in descending order). For example a vector c of length n+1 corresponds | |
28 ## to the following nth order polynomial | |
29 ## | |
30 ## p(x) = c(1) x^n + ... + c(n) x + c(n+1). | |
31 ## | |
32 ## polyval(c,x) will evaluate the polynomial at the specified value of x. | |
33 ## | |
34 ## If x is a vector or matrix, the polynomial is evaluated at each of the | |
35 ## elements of x. | |
36 ## | |
37 ## SEE ALSO: polyvalm, poly, roots, conv, deconv, residue, filter, | |
38 ## polyderiv, polyinteg | |
39 | 39 |
40 ## Written by Tony Richardson (amr@mpl.ucsd.edu) June 1994. | 40 ## Written by Tony Richardson (amr@mpl.ucsd.edu) June 1994. |
41 | 41 |
42 if (nargin != 2) | 42 if (nargin != 2) |
43 usage ("polyval (c, x)"); | 43 usage ("polyval (c, x)"); |