evaluates the polynomial for given values
y = polyval(p, x) y = polyval(p, x, [], mu) [y, d] = polyval(p, x, S) [y, d] = polyval(p, x, S, mu)
vector of doubles or polynom, the polynomial coefficients
real or complex vector/matrix
a structure (second output of polyfit) containing the following fields:
a matrix of doubles, the triangular factor R form the qr decomposition
a real, the degrees of freedom
a real, the norm of the residuals
a 1
x 2
vector
(third output of polyfit). mu(1)
is
mean(x)
and mu(2)
is stdev(x)
a real or complex vector/matrix, the result of the polynomial evaluated at x
a vector of the same size as x
, the standard error for prediction
y = polyval(p, x) evaluates the polynomial p at each value of x.
p
can be a vector containing the coefficients of the polynomial (output of
polyfit function) or a polynom.
The structure S, the second output argument of polyfit function, is used to compute d
,
standard error for prediction.
y = polyval(p, x, [], mu) or [y, d] = polyval(p, x, S, mu)
evaluates the polynomial p at each centered and scaled points: (x - mu(1))/mu(2)
. mu
is the third output argument
of polyfit function.
x = 0:5; // polynom: p(x) = 3x^2+2x+1 p = [3, 2, 1] y = polyval(p, x); p = poly(1:3, 'x', 'coeff'); y2 = polyval(p, x); y == y2 | ![]() | ![]() |
Version | Description |
2025.0.0 | Introduction in Scilab. |