evaluate a cubic polynomial in an interval
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi at everybody,
I have to evaluate a cubic polynomial in an interval;
I have a polynomials coefficients vector (C) in the form
v1= ( a1 * x^3 ) + ( b1 * x^2 ) + ( c1*x ) + (d1)
and the interval [i_k , i_(k+1)]
Is there a command to do this?
thanks
2 Commenti
Risposte (2)
John Petersen
il 20 Nov 2012
If you mean you want to evaluate v1 at x values between the kth and (k+1)th values of x, then define x as the interval of interest, define an array for your coefficients and then use polyval to evaluate the polynomial at the values of x you have specified. You can plot the result to see if it's what you expected.
x = [starting_value:stepsize:ending_value];
c = [a1 b1 c1 d1];
v1 = polyval(c,x);
figure;plot(x,v1)
0 Commenti
Vedere anche
Categorie
Scopri di più su Polynomials in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!