<< CL_dot Math CL_fsolveb >>

CelestLab >> Math > CL_evalPoly

CL_evalPoly

Evaluation of polynomial or polynomial derivatives

Calling Sequence

val = CL_evalPoly(coeffs,t [,nd])

Description

Parameters

coeffs :

Polynomial coefficients. Each row corresponds to a different polynomial. (PxM)

t :

Values for the evaluation (1xN)

nd :

(optional) Derivation order. Default is 0.

Authors

Examples

// Example 1:
coeffs = [0,1,2];  // P(x) = x + 2*x^2
CL_evalPoly(coeffs,[0,1])
CL_evalPoly(coeffs,[0,1],1) // P'(x) = 1 + 4*x
CL_evalPoly(coeffs,[0,1],2) // P''(x) = 4;
CL_evalPoly(coeffs,[0,1],3) // P'''(x) = 0;

// Example 2:
t=-0.05:0.001:0.05;
coeffs = rand(500,3,"normal"); // 1000 2nd degree polynoms
x = CL_evalPoly(coeffs,t);     // polynom values
x2 = CL_evalPoly(coeffs,t,2);  // second derivative

Report an issue
<< CL_dot Math CL_fsolveb >>