Evaluation of polynomial or polynomial derivatives
val = CL_evalPoly(coeffs,t [,nd])
Computes the value of a polynomial or its derivatives.
The polynomials are defined by the coefficients coeffs. Each row (number i) in coeffs contains the coefficients of the ith polynom. coeffs(i,k) is the coefficient of the term t^(k-1).
The evaluation is done for each value in t.
nd is the derivation order:
- nd == 1 => first derivative
- nd == 2 => second derivative
- etc...
Polynomial coefficients. Each row corresponds to a different polynomial. (PxM)
Values for the evaluation (1xN)
(optional) Derivation order. Default is 0.
CNES - DCT/SB
// 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 |