MATLAB简单程序大全.docxVIP

  • 6
  • 0
  • 约3.8千字
  • 约 7页
  • 2021-11-10 发布于天津
  • 举报
PAGE PAGE # / 7 MATLAB简单程序大全 求特征值特征向量 A=[2 3 4:l 5 9;8 5 2] dct(A) A, rank(A) inv(A) rref(A) eig(A)%求特征值和特征向量 卫星运行问题 h=200.H=51000,R=6378; a=(h+H+2*R)/2; c=(H-h)⑵ b=(aA2-cA2)A(l/2); e=c/a; f=sqrt( 1 -exp(2).*cos(t)A2); l=int(f,t,0,pi/2) L=4*a.*l 动态玫瑰线 n=3;N= 10000: theta=2*pi*(0:N)/N; r=cos(n*theta); x=r.*cos(theta); y=r.*sin(theta); comet(x,y) 二重积分 syms x y f=xA2*sin(y); int(int(f,xAlhyApi) ezmesh(fJ0J Api]) 函数画图 syms x:f=exp(-0.2*x)*sin(0.5*x); ezplot(f,[0,8*pi]) 玫瑰线 theta=0:0.01:2*pi; r=cos(3*theta); polar(thctaj/r*) 求xA2+yA2=l和x+z八2=1所围成的体积 syms x y z R r=l; Z=sqrt(l-xA2); yO=Z; V=8*int(int(Z,y,O,yO),x,O」) 求导数及图像 f= l/(5+4*cos(x)y; subplot( 1,2J);ezplot(f) fl=diff(f) subplot( 1,22);ezplot(f 1) 绕X轴旋转 t=(0:20)*pi/10; r=exp(-.2*t).*sin(.5*t); theta=t; x=t*ones(size ⑴); y才*cos(theta); z=rf*sin(theta); mesh(x,y,z) colormap([0 0 0]) 某年是否闰年 year=input(,input year:=); nl=year/4; n2=year/100; n3=year/400; if nl==fix(nl)n2-=fix(n2) dispC是闰年) elseif nl==fix(nl )n3==fix(n3) dispC是闰年) else dispC不是闰年,) End 玫瑰线的绘制 theta=0:0.001:2*pi; rho=2*cos(3*theta); figure( 1 );polar(theta.rho) x=rho.*cos(theta); y=rho.*sin(theta); figure(2);comet(x,y) 相遇问题 function k=moto(A,B) if nargin==0,A=0:B=100;end va=10;vb=8;vc=60: f=l;k=O; whi!e(B-A)0.2 iff==l tk=(B-A)/(vb+vc); else tk=(B-A)/(vc+va); end A=A+va*tk; B=B-vb*tk; f=-f: k=k+I; End 数学实验 syms x; x=l:100; f(x)=exp(-0.2*x).*sin(0.5*x); syms x; x=l:100; f(x)=exp(-0.2*x).*sin(0.5*x); plot(xJ(x)) syms x; x=0:0.1:2*pi; f(x)=exp(-0.2*x)*sin(0.5*x); plot(xJ(x)) syms x: x=0:0.1:2*pi; f(x)=exp(-0.2*x).*sin(0.5*x); plot(xJ(x)) syms x; x=0:0.1:2*pi; f(x)=exp(-0.2*x).*sin(0.5*x); zplot(xj(x)) clc f=sym(,sin(x)/xl); limit(f) fl=sym((l+a/x)W) limit(fl) f 1 =sym(( 1 +a/x)Ax),x=inf; limit(fl) clc fl=sym(,(l+l/x)Ax,); limit(fl;inf) fl=sym(,(l+l/x)Ax,); limit(fl?inf) clc limit(fl;x\inf) Clc 相遇问题 A=0;B=100; va=10;vb=8;vc=60; f=l;k=O; plot(A.0/ro\B,0/gor),hold on whiIe(B-A)0.2 iff==l tk=(B-A)/(vb+vc); else tk=(B-A)/(vc+va); end A=A+va*tk: B=B-vb*tk; plot

文档评论(0)

1亿VIP精品文档

相关文档