Xdương Văn Hải - 2018600865
Xdương Văn Hải - 2018600865
>> v=polyval(p,2.8)
v=
1.4527e+04
Bai 2;
y=
14 0 0 0 0 12 9 0 -2 10
>> r=roots(y)
r=
-1.0093 + 0.0000i
-0.7213 + 0.5763i
-0.7213 - 0.5763i
-0.1804 + 1.0689i
-0.1804 - 1.0689i
0.9165 + 0.5216i
0.9165 - 0.5216i
0.4898 + 0.6288i
0.4898 - 0.6288i
Bai 3
thuong 2 da thuc
q=input('Nhap da thuc q= ');
p=input('Nhap da thuc p= ');
w=conv(q,p);%tich 2 da thuc
disp (['tich 2 da thuc: ', num2str(w)])
>> bai3
Q=
1.0e+04 *
R=
1.0e+06 *
0 0 0 0 6.0685 0.7774
Bai4
%daohamqpvatich
q=input('Nhap da thuc q= ');
p=input('Nhap da thuc p= ');
dq=polyder(q);%daohamq
dp=polyder(p);%daohamp
dqp=polyder(q,p)%daohamtich
disp (['daohamq= ', num2str(dq)])
disp (['daohamp= ', num2str(dp)])
disp (['daohamtichqp= ', num2str(dqp)])
>> daohamqpvatich
dqp =
daohamp= 4 -70
a=
b=
Bai 5
VE DO THI q
>> s=linspace(1,30,30)
s=
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 11 12 13
Columns 14 through 26
14 15 16 17 18 19 20 21 22 23 24 25 26
Columns 27 through 30
27 28 29 30
>> y=4*s.^5-5*s.^2-42*s-2
y=
Columns 1 through 6
Columns 7 through 12
Columns 13 through 18
Columns 19 through 24
>> plot(s,y)
Ve do thi p
>> s=linspace(1,30,30)
s=
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 11 12 13
Columns 14 through 26
14 15 16 17 18 19 20 21 22 23 24 25 26
Columns 27 through 30
27 28 29 30
y=
Columns 1 through 13
-77 -141 -201 -257 -309 -357 -401 -441 -477 -509 -537 -561 -581
Columns 14 through 26
-597 -609 -617 -621 -621 -617 -609 -597 -581 -561 -537 -509 -477
Columns 27 through 30
>> plot(s,y)
Ve do thi q*p
>> y=8*s.^7-280*s.^6-36*s.^5-10*s.^4+266*s.^3+2981*s.^2+518*s+18
y=
1.0e+10 *
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
-0.3526 -0.4692 -0.6109 -0.7793 -0.9751 -1.1975 -1.4441 -1.7102
Columns 25 through 30
>> plot(s,y)
Ve do thi q/p
>> s=linspace(1,30,30)
s=
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 11 12 13
Columns 14 through 26
14 15 16 17 18 19 20 21 22 23 24 25 26
Columns 27 through 30
27 28 29 30
y=
1.0e+05 *
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
Columns 25 through 30
Ve do thi z=
>> x=linspace(1,30,30)
x=
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 11 12 13
Columns 14 through 26
14 15 16 17 18 19 20 21 22 23 24 25 26
Columns 27 through 30
27 28 29 30
>> z=x.*exp(-x.^2-x+1)
z=
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
Columns 25 through 30
0.0000 0.0000 0 0 0 0
>> plot(x,z)
Bai 6
Z = X1 .* exp(-X1.^2 - X2.^2);
mesh(Z)