随机过程matlab程序.doc

  1. 1、本文档共21页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
基本操作 -5/(4.8+5.32)^2 area=pi*2.5^2 x1=1+1/2+1/3+1/4+1/5+1/6 exp(acos(0.3)) a=[1 2 3;4 5 6;7 8 9] a=[1:3,4:6,7:9] a1=[6: -1:1] a=eye(4) a1=eye(2,3) b=zeros(2,10) c=ones(2,10) c1=8*ones(3,5) d=zeros(3,2,2); r1=rand(2, 3) r2=5-10*rand(2, 3) r4=2*randn(2,3)+3 arr1=[1.1 -2.2 3.3 -4.4 5.5] arr1(3) arr1([1 4]) arr1(1:2:5) arr2=[1 2 3; -2 -3 -4;3 4 5] arr2(1,:) arr2(:,1:2:3) arr3=[1 2 3 4 5 6 7 8] arr3(5:end) arr3(end) 绘图 x=[0:1:10]; y=x.^2-10*x+15; plot(x,y) x=0:pi/20:2*pi y1=sin(x);y2=cos(x); plot(x,y1,b-); hold on; plot(x,y2,‘k--’); legend (‘sin x’,‘cos x’); x=0:pi/20:2*pi; y=sin(x); figure(1) plot(x,y, r-) grid on 以二元函数图 z = xexp(-x^2-y^2) 为例讲解基本操作,首先需要利用meshgrid函数生成X-Y平面的网格数据,如下所示: xa = -2:0.2:2; ya = xa; [x,y] = meshgrid(xa,ya); z = x.*exp(-x.^2 - y.^2); mesh(x,y,z); 建立M文件 function fenshu( grade ) if grade 95.0 disp(The grade is A.); else if grade 86.0 disp(The grade is B.); else if grade 76.0 disp(The grade is C.); else if grade 66.0 disp(The grade is D.); else disp(The grade is F.); end end end end end function y=func(x) if abs(x)1 y=sqrt(1-x^2); else y=x^2-1; end function summ( n) i = 1; sum = 0; while ( i = n ) sum = sum+i; i = i+1; end str = [?????á1??a£o,num2str(sum)]; disp(str) end 求极限 syms x limit((1+x)^(1/x),x,0,right) 求导数 syms x; f=(sin(x)/x); diff(f) diff(log(sin(x))) 求积分 syms x; int(x^2*log(x)) syms x; int(abs(x-1),0,2) 常微分方程求解 dsolve(Dy+2*x*y=x*exp(-x^2),x) 计算偏导数 x/(x^2 + y^2 + z^2)^(1/2) diff((x^2+y^2+z^2)^(1/2),x,2) 重积分 int(int(x*y,y,2*x,x^2+1),x,0,1) 级数 syms n; symsum(1/2^n,1,inf) Taylor展开式 求y=exp(x)在x=0处的5阶Taylor展开式 taylor(exp(x),0,6) 矩阵求逆 A=[0 -6 -1; 6 2 -16; -5 20 -10] det(A) inv(A) 特征值、特征向量和特征多项式 A=[0 -6 -1; 6 2 -16; -5 20 -10]; lambda=eig(A) [v,d]=eig(A) poly(A) 多项式的根与计算 p=[1 0 -2 -5]; r=roots(p) p2=pol

文档评论(0)

2232文档 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档