Professional Documents
Culture Documents
figure
subplot(1,2,1)
hold on
ezplot(y1,[0 2])
xx=[0.2:0.2:0.8]
yy=subs(y1,xx)
u=[1,1,1,1];
v=subs(diff(y1,x),xx)
quiver(xx,yy,u,v)
hold off
subplot(1,2,2)
hold on
ezplot(y2,[0 2])
tt=[0.2:0.2:0.8]
yy=subs(y2,tt)
u=[1,1,1,1];
v=subs(diff(y2,t),tt)
quiver(tt,yy,u,v)
hold off
3.19
>> ezplot(f,[0,1])
>> grid
>>xmin = fminbnd(char(f),0,1)
xmin =
0.3820
ymin =
6.2065
df =diff(f)
df =
nghiem =
nghiem =
5^(1/2)/2 + 3/2
3/2 - 5^(1/2)/2
>> x1 =eval(nghiem(1))
x1 =
2.6180
>> x2=eval(nghiem(2))
x2 =
0.3820
>>a = subs(f,x,x2)
a=
6.2065
>> explot(exp(x),0,1)
??? Undefined function or method
'explot' for input arguments of type
'sym'.
>> ezplot(exp(x),0,1)
>> grid
>> hold on
>> ezplot(a*x*(1-x),0,1)
>>
Bai 20
f = exp(-x^2)*(x+sqrt(x))
f=
(x + x^(1/2))/exp(x^2)
>> ezplot(f,.5,.7)
??? Error using ==> figure
Single input must be an existing figure
handle or a scalar integer from 1 to
2147483646
>> ezplot(f)
>> ezplot(f)
>> xmin =fminbnd(char(f),0.5,0.7)
xmin =
0.6999
xmin =
0.5992
xman =
0.5992
ymax =subs(f,x,xman)
ymax =
0.9590
4.15
a=[1 2 3;2 -3 2;3 1 -1]
a=
2 -3
1 -1
>> b =[6;14;-2]
b=
6
14
-2
>> c = a\b
c=
1.0000
-2.0000
3.0000
>> rref(c)
ans =
1
0
>> x = a\b
x=
1.0000
-2.0000
3.0000
>> c =[a,b]
c=
2 -3
3
2 14
1 -1 -2
>> rref(c)
ans =
0 -2
>>4.16
a=
2 -3
>> b = [4;-4]
b=
4
-4
>> a/b
??? Error using ==> mrdivide
Matrix dimensions must agree.
>> a\b
ans =
0
1.5385
0.3077
>> a/b
??? Error using ==> mrdivide
Matrix dimensions must agree.
>> a\b
ans =
0
1.5385
0.3077
>> b=[-4;4]
b=
-4
4
>> a\b
ans =
0
-1.5385
-0.3077
rref([a,b])
ans =
Columns 1 through 3
1.0000
0 1.8571
0 1.0000 0.5714
Column 4
-0.5714
-1.7143
5.1
function xdot = viphan2(t,x)
xdot = 1 -2*x*t
end
ode23('viphan2',[0,3],1)
4.22
c. so snh ta tnh hsdk = norm(a) nhn vi ma trn nghch o ca a.
hs b hn tt hn
5.6
Y=
T0=fminbnd(@(t)y...,0,1)
T1 = fminbnd(,1,2)
T = t1 t0 tm ra t => f
5.7 khng ph hp. k ra