Escolar Documentos
Profissional Documentos
Cultura Documentos
Experiment No: 4
Experiment Name:
Submitted By:
Roll : 145011
Dept : IPE
1.Roots of polynomial
𝑥 5 - 7𝑥 3 + 4𝑥 2 +x-10
Command window
>> x= [1 0 -7 4 1 -10];
>> roots (x)
ans =
2.4252 + 0.0000i
-2.8010 + 0.0000i
0.7090 + 0.9537i
0.7090 - 0.9537i
-1.0423 + 0.0000i
3.Polynomial Differentiation
𝐱 𝟑 +10x+10
Command window
>> syms x;
>> func= x^3+10*x+10;
>> diff(func,x)
ans =
3*x^2 + 10
7.Trapezoidal rule
3
1
∫
1 x2
Command window
>> y=(1./(x.^2));
>> x=linspace(1,3,8);
>> y=(1./(x.^2));
>> trapz(x,y)
ans =
0.6796
8.Simpson rule
3
1
∫
1 x2
Command window
>> syms x;
>> area =int(1./(x.^2),1,3)
area =
2/3