POLYVAL

polyval

 p(x)=3x2+2x+1 at the points x=5,7,9
p = [3 2 1];
x = [5 7 9];
y = polyval(p,x)
y = 1×3

    86   162   262


I=31(3x44x2+10x25)dx.
Create a vector to represent the polynomial integrand 3x44x2+10x25. The x3 term is absent and thus has a coefficient of 0.
p = [3 0 -4 10 -25];
Use polyint to integrate the polynomial using a constant of integration equal to 0.
q = polyint(p)
q = 1×6

    0.6000         0   -1.3333    5.0000  -25.0000         0

Find the value of the integral by evaluating q at the limits of integration.
a = -1;
b = 3;
I = diff(polyval(q,[a b]))


Yorumlar

Bu blogdaki popüler yayınlar

POLYFIT

XLSREAD