




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
Matlab軟件(1)
?z=sqrt(4*xA2+l)+0.5457expA(-0.75*xA2-3.75*yA2-1.5x)/
(2*sin3*y-D
???z=sqrt(4*xA2+l)+0.5457expA(-0.75*xA2-3.75*yA2-1.5x)/
(2*sin3*y-D
I
Error:Missingvariableorfunction.
?z=sqrt(4.*x.A2+l)+0.5457exp.A(-0.75.*x.A2-3.75.*y.A2-1.5x)./
(2.*sin3.*y-l)
???z=sqrt(4.*x.A2+l)+0.5457exp.A(-0.75.*x.A2-3.75.*y.A2-1.5x)./
(2.*sin3.*y-l)
I
Error:Missingvariableorfunction.
?z=(sqrt(4.*x.A2+l)+0.5457exp.A(-0.75.*x.A2-3.75.*y.A2-1.5x))./
(2.*sin(3.*y)-l)
???z=(sqrt(4.*x.A2+l)+0.5457exp.A(-0.75.*x.A2-3.75.*y.A2-1.5x))./
(2.*sin(3.*y)-l)
Error:Missingvariableorfunction.
?
z=(sqrt(4*xA2+l)+0.5457*exp(-0.75*x-3.75*yA2-1.5*x))/(2*sin(3*y)-l
)
???Undefinedfunctionorvariable'x'.
?x=l;y=2;
?
z=(sqrt(4*xA2+l)+0.5457*exp(-0.75*x-3.75*yA2-1.5*x))/(2*sin(3*y)-l
)
z=
-1.4345
?x=(-l+sqrt(-5))/4
x=
-0.2500+0.5590i
?y=x+8+10i
7.7500+10.5590i
?A='她是我們班最好的學(xué)生'
???A='她是我們班最好的學(xué)生’
I
Error:Missingvariableorfunction.
?A=,她是我們班最好的學(xué)生,
A=
她是我們班最好的學(xué)生
?A=[123;-213;-321]
A=
123
-213
-32
?B=|l43;328;523]
B=
143
328
523
?A==B
ans=
101
000
010
?A<=B
ans=
?A>=B
ans=
101
000
010
?A<0
ans=
000
100
100
?A|B
ans=
?A&B
ans=
?A>2&B<5
ans=
00
000
000
?A~=B
ans=
00
101
Matlab軟件(2)
(l)x=|0:0.1:l|
Columns1through9
00.10000.20000.30000.40000.5000
0.60000.70000.8000
Columns10through11
0.90001.0000
?y=x*exp(-x)
???Errorusing==>mtimes
Innermatrixdimensionsmustagree.
?y=x*exp(-x);
???Errorusing==>mtimes
Innermatrixdimensionsmustagree.
?y=x.*exp(-x)
y=
Columns1through9
00.09050.16370.22220.26810.3033
0.32930.34760.3595
Columns10through11
0.36590.3679
?Plot(x,y)
⑵
(3)fori=l:6
a=0.5+i*0.5
t=[0:0.1:2*pi]
x=a*cos(t)
y=sqrt(25-aA2)*sin(t)
Plot(x,y)
holdon
(4)t=[0:0.1:2*pi];
x=2*(cos(t)).A3
y=2*(sin(t)).A3;
Plot(x,y)
'Z:SO:H:SO:Z-=x?(s)
z
[x,y]=meshgrid(x,y)
?z=x.A2+y.A2;
?surf(x,y,z)
(6)?clearall;closeall;
?[x,y]=meshgrid(-l.5:0.1:1.5,-2:0.1:2);
?
z=0.54*exp(-0.75*x.A2-3.75*y.A2-1.5*y).*(x+y>l)+0.7575*exp(-x.
A2-6*y.A2).*((x+y>-l)&(x+y<=l))+0.5457*exp(-0.75*x.A2-3.75*y.
A2+1.5*y).*(x+y<=-l);
>>surf(x,y,z);
Matlab(3)
(l)s=O
forn=l:20
t=l
fori=l:n
t=t*i
end
s=s+t
end
2.5613e+018
(2)s=0;i=l
whilei<=200
s=s+i
i=i+l
end
s
s=
20100
(3)?functions=yuan(r)
%求半徑為r的圓的面積
%s=yuan(r)
s=pi*rA2
?r=3
r=
3
?s=yuan(r)
28.2743
28.2743
(4)?clearall
r=input(,輸入圓的半徑,)
s=pi*rA2
輸入圓的半徑
r=
II
s=
11
?r=12
r=
12
?s=yuan(r)
452.3893
Matlab(4)
1.1?symsxn
?f=(l+x/n)An
f=
(l+x/n)An
?limit(f,n,inf)
ans=
exp(x)
1.2?symsnx
?f=(-l)An*(xAn/n)
f=
(-l)An*xAn/n
?symsum(f,n,l,inf)
ans=
-log(l+x)
2.1?symsxy
?f=((xA2)*exp(-y))
xA2*exp(-y)
?diff(f,x,2)
ans=
2*exp(-y)
2.1(2)symsxy
?f=((xA2)*exp(-y))
f=
xA2*exp(-y)
diff(f,x)
ans=
2*x*exp(-y)
?diff(f,y)
ans=
-xA2*exp(-y)
?x=l,y=2
y=
2
-xA2*exp(-y)
ans=
-0.1353
2.2?symsxlx2
?A=[(xl)*exp(x2);cos(xl)]
A=
xl*exp(x2)
cos(xl)
?jacobian(A,[xl,x2|)
ans=
[exp(x2),xl*exp(x2)|
[-sin(xl),0]
?jacobian(A,[xl,xl|)
ans=
[exp(x2),exp(x2)]
[-sin(xl),-sin(xl)]
?jacobian(A,[x2,x2|)
ans=
[xl*exp(x2),xl*exp(x2)|
I0,0|
?jacobian(A,[x2,xl|)
ans=
[xl*exp(x2),exp(x2)|
[0,-sin(xl)!
2.3?symsfx
?f=log(x)*sin(x)
f=
log(x)*sin(x)
taylor(f,5,l,x)
ans=
sin(l)*(x-l)+(cos(l)-l/2*sin(l))*(x-l)A2+(-l/6*sin(l)-l/2*cos(l))*
(x-l)A3+l/6*cos(l)*(x-l)A4
3.1symsft
?f=exp(-t)+sin(t)
f=
exp(-t)+sin(t)
?int(f,t)
ans=
-exp(-t)-cos(t)
3.2symsft
?f=exp(-t)+sin(t)
f=
exp(-t)+sin(t)
?int(f,t,O,l)
ans=
-exp(-l)-cos(l)+2
3.3symsgx
?g=3*sin(xA2)/x
g=
3*sin(xA2)/x
?int(g,x,l,4)
ans=
3/2*sinint(16)-3/2*sinint(l)
3.4symsgx
?g=exp(-xA(sin(x)))
g=
exp(-xAsin(x))
?int(g,x,O,l)
Warning:Explicitintegralcouldnotbefound.
>Inat58
ans=
int(exp(-xAsin(x)),x=0..1)
3.5?symsfxy
?f=2*sqrt(l-xA2)
f=
2*(l-xA2)A(l/2)
?int(f,y,-sqrt(l-xA2),sqrt(l-xA2))
ans=
4-4*xA2
?int(ans,x,-l,l)
ans=
16/3
3.6?symsfx
?f=exp(-x)*sin(x)
f=
exp(-x)*sin(x)
?int(f,x,l,inf)
ans=
l/2*exp(-l)*cos(l)+l/2*exp(-l)*sin(l)
Matlab(5)
(1)
?eye(4)
ans=
1000
0100
0010
0001
(2)
?rand(4,4)
ans=
0.95010.89130.82140.9218
0.23110.76210.44470.7382
0.60680.45650.61540.1763
0.48600.01850.79190.4057
(3)?A=[5756;71087;68109;57910]
A=
5756
71087
68109
57910
?A.,
ans=
5765
71087
58109
67910
?det(A)
ans=
28
?rank(A)
ans=
?inv(A)
ans=
2.4286-2.14292.4286-2.1429
-1.46431.5714-1.71431.3214
-0.60710.28570.14290.0357
0.3571-0.2857-0.14290.2143
?eig(A)
ans=
30.2769
3.7132
0.4281
0.5818
?[VD]=eig(A)
0.37940.32800.78800.7464
0.52870.6600-0.5025-0.4678
0.5522-0.2598-0.2801-0.3655
0.5212-0.62390.21920.3007
D=
30.2769000
03.713200
000.42810
0000.5818
(4)A=[21-11;121-1;1121]
A=
21
12
2
?B=[l;2;3]
B=
1
2
3
?A\B
ans=
1
0
1
0
(5)?A=[21-11;121-1;1121]
A=
2
2
12
?B=[l;2;3]
B=
2
3
?A\B
ans=
1
0
1
0
?A=[12-2;-2-24;24-2]
A=
12-2
-2-24
24-2
?[VJ]=jordan(A)
02.2127-0.2127
0.5000-0.79570.2957
0.50000.7957-0.2957
J=
2.000000
0-0.43840
00-4.5616
(6)
>A=[4-313;2-135;1-1-1-1;3-234;7-6-70|
A=
4-313
2-135
1-1-1-1
3-234
7-6-70
rref(A)
ans=
1006
0107
0010
0000
0000
例題:
A=[135;l23;542]
A=
135
123
542
Matlab(8)
例題1:?clear;N=10000;
x=unifrnd(-l,l,N,l);y=unifrnd(-l,l,N,l);z=rand(N,l);
Cl=(x.A2+y.A2)<l;C2=(x.A2+z.A2)<l;
Nc=sum(Cl&C2);I=(Nc/N)*4
2.6508
?clear;N=10000;
x=unifrnd(-l,l,N,l);y=unifrnd(-l,l,N,l);z=rand(N,l);
Cl=(x.A2+y.A2)<l;C2=(x.A2+z.A2)<l;
Nc=sum(Cl&C2);I=(Nc/N)*4
2.6864
?clear;N=10000;
x=unifrnd(-l,l,N,l);y=unifrnd(-l,l,N,l);z=rand(N,l);
Cl=(x.A2+y.A2)<l;C2=(x.A2+z.A2)<l;
Nc=sum(Cl&C2);I=(Nc/N)*4
2.6340
例題2:clear;close;x=linspace(-2.*pi,2.*pi,300000)
f=(l-x.A3).*sin(3.*x)
plot(x,f)
fun=inline(T)
x=fminbnd(fun,-2.*pi,2.*pi),f=feval(fun,x);
x=unifrnd(-2.*pi,2.*pi,300000,1)
f=-min(feval(fun,x))
Matlab(6)
例題:
l.?dsolve(,Du=l+uA2,)
ans=
tan(t+Cl)
2.?dsolve(,D2y+4*Dy+29*y,;y(0)=0,,,Dy(0)=15,,,x,)
ans=
3*exp(-2*x)*sin(5*x)
3.?
dsolve(,Dx=2*x-3*y+3*z*,,Dy=4*x-5*y+3*z*,,Dz=4*x-4*y+2*z,,*t,)
ans=
x:|lxlsym|C2*exp(-t)+C3*exp(2*t)
y:[1x1sym]C2*exp(-t)+C3*exp(2*t)+exp(-2*t)*Cl
z:[1x1sym]C3*exp(2*t)+exp(-2*t)*Cl
4.functiondy=my2011(t,y)
dy=zeros(2,l);
dy⑴=y(2);
dy(2)=1000*(l-y(l)^2)*y(2)-y(l)
Odel5s(@my2011,[03000],[20])
1500
0
-1000
-15001-----------------1-----------------1------------------1-----------------?-----------------1-----------------
050010001500200025003000
5.functiondy=my2012(t,y)
dy=zeros(3,l)
dy(l)=y(2)*y(3);
dy(2)=-y(l)*y(2);
dy(3)=-0.51*y(l)*y(2);
ode45(@my2012,|01000|,[011|)
1.4
12
0.
0.6
0端
02
-0.2
01002003004006007008009001000
練習(xí):1(a),?dsolve(*Dy=(x+y)*(x-y),,,x,)
ans=
-x*(-Cl*besseli(-3/4,l/2*xA2)+besselk(3/4,l/2*xA2))/(Cl*besseli(l/4,l/2
*xA2)+besselk(l/4,l/2*xA2))
1(b)?dsolve(,x*Dy=y*tan(y/x),,,y(10)=r,,x,)
???Errorusing==>dsolve
Error,(indsolve/IC)The?implicit*optionisnotavailablewhengiving
InitialConditions.
1(c)dsolve(,Dy=-x*sin(x)/cos(y),,,y(2)=r,,x,)
ans=
asin(-sin(x)+x*cos(x)+sin(2)-2*cos(2)+sin(l))
2,dsolve(,Df=f+2*g',,Dg=f+4,)
ans=
f:|lxlsym]-exp(-t)*C2+2*exp(2*t)*C1-4
g:[1x1sym]exp(-t)*C2+exp(2*t)*Cl+2
3.方法1?dsolve('Df=f+g,,,Dg=-f+g,,,f(0)=2,,,g(0)=5,)
ans=
f:|lxlsym]exp(t)*(5*sin(t)+2*cos(t))
g:[1x1sym]-exp(t)*(-5*cos(t)+2*sin(t))
方法2:
?functiondy=love(t,y)
dy=zeros(2,l);
dy(l)=y(l)+y(2);
dy(2)=-y(l)+y(2);
ode45(@love,[03000],[25])
s307
X10
500WOO150020003000
Matlab(7)
例題:1、f=[-4;-5;-6];A=[l,-l,l;3,2,4;3,2,0]
A=
1-11
324
320
?b=[20;42;30];b=zeros(3,l)
0
0
0
[x,feval]=linprog(f,A,b,[],[],b)
Optimizationterminated.
X=
1.0e-011*
0.0000
0.1418
0.0820
feval=
-1.2010e-011
練習(xí)題:
1、f=[l1-4000]
11-4000
?Aeq=[l12100;11-1010;-l11006]
Aeq=
112100
11-1010
-111006
?Aeq=[l121001-1010;-l11006]
Aeq=
112100
11-1010
-111006
?Aeq=[l12100;1-1010;-l11001]
Aeq=
11210
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 山東省威海乳山市2024-2025學(xué)年九年級(jí)上學(xué)期期末化學(xué)試題(含答案)
- 2025年消防設(shè)施操作員之消防設(shè)備基礎(chǔ)知識(shí)基礎(chǔ)試題庫和答案要點(diǎn)
- 景觀橋分析面試題及答案
- 2023-2024學(xué)年廣東省廣州市越秀區(qū)執(zhí)信中學(xué)七年級(jí)(下)期中數(shù)學(xué)試卷(含答案)
- 廣東省廣州市中大附中2023-2024學(xué)年八年級(jí)下學(xué)期期中物理試題(含答案)
- 采購合同范本(2篇)
- 電器知識(shí)技能培訓(xùn)班課件
- 關(guān)于調(diào)整工作時(shí)間與資源配置的通知
- 租賃協(xié)議合同
- 山東省青島萊西市(五四制)2024-2025學(xué)年八年級(jí)上學(xué)期期末生物學(xué)試題(含答案)
- 《關(guān)于費(fèi)爾巴哈的提綱》
- 人力資源管理參考文獻(xiàn)(匯總112個(gè)最新),參考文獻(xiàn)
- 學(xué)憲法講憲法-課件
- 基于PLC的郵件分揀機(jī)控制系統(tǒng)設(shè)計(jì)
- DB11-T 950-2022水利工程施工資料管理規(guī)程
- 購物卡購銷合同
- 變配電室巡視檢查記錄
- 現(xiàn)場談單的流程與技巧(學(xué)大教育內(nèi)部培訓(xùn)資料)
- 法人授權(quán)委托書
- 印萌打印平臺(tái)合作協(xié)議VIP
- 中國建設(shè)銀行信貸業(yè)務(wù)申請書
評(píng)論
0/150
提交評(píng)論