欢迎来到天天文库
浏览记录
ID:14539174
大小:176.50 KB
页数:37页
时间:2018-07-29
《matlab编程练习(含答案很好的)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、001双峰曲线图:z=peaks(40);mesh(z);surf(z)002解方程:A=[3,4,-2;6,2,-3;45,5,4];>>B=[14;4;23];>>root=inv(A)*B003傅里叶变换loadmtlb;subplot(2,1,1);plot(mtlb);>>title('原始语音信息');>>y=fft(mtlb);>>subplot(2,1,2);>>yy=abs(y);>>plot(yy);>>title('傅里叶变换')004输入函数:a=input('Howmanyapples','s')005输出函数a=[1234;5678;12233
2、445;344352334]a=1234567812233445344352334disp(a)a=1234567812233445344352334b=input('howmanypeople','s')37howmanypeopletwopeopleb=twopeople>>disp(b)twopeople>>006求一元二次方程的根a=1;b=2;c=3;d=sqrt(b^2-4*a*c);x1=(-b+d)/(2*a)x1=-1.0000+1.4142i>>x2=(-b-d)/(2*a)x2=-1.0000-1.4142i007求矩阵的相乘、转置、存盘、读入数据A
3、=[135;246;-10-2;-300];>>B=[-13;-22;21];>>C=A*BC=314220-3-53-9>>C=C'C=3732-331420-5-9>>savemydatC>>clear>>loadmydatC008编写数学计算公式:A=2.1;B=-4.5;C=6;D=3.5;E=-5;K=atan(((2*pi*A)+E/(2*pi*B*C))/D)K=1.3121009A=[10-1;241;-205];>>B=[0-10;213;112];>>H=2*A+BH=2-1-2695-3112>>M=A^2-3*BM=33-6213-2-15-321>>
4、Y=A*BY=-1-2-29314571037>>R=B*AR=-2-4-1-2414-1410>>E=A.*BE=000443-2010>>W=ABW=0.3333-1.33330.66670.25001.00000.25000.3333-0.33330.6667>>P=A/BP=-2.00003.0000-5.0000-5.00003.0000-4.00007.0000-9.000016.0000>>Z=A.BWarning:Dividebyzero.Z=0-Inf01.00000.25003.0000-0.5000Inf0.4000>>D=A./BWarning:D
5、ividebyzero.37D=Inf0-Inf1.00004.00000.3333-2.000002.5000010a=4.96;b=8.11;>>M=exp(a+b)/log10(a+b)M=4.2507e+005011求三角形面积:a=9.6;b=13.7;c=19.4;>>s=(a+b+c)/2;>>area=sqrt(s*(s-a)*(s-b)*(s-c))area=61.1739012逻辑运算A=[-10-68;-94012.3;00-5.1-2;0-230-7];>>B=A(:,1:2)B=-10-94000-23>>C=A(1:2,:)C=-1.00000-6
6、.00008.0000-9.00004.0000012.300037>>D=B'D=-1-900040-23>>A*Bans=1.0000-184.0000-27.0000-266.9000046.0000207.000069.0000>>C>C&Dans=10000101>>C
7、Dans=11111101>>~C
8、~Dans=0111101037013矩阵运算练习:A=[895;36-711;21-85]A=89536-71121-85>>BB=-13-2203-319>>RT=A*BRT=-52956-831196-5268-21>>QW=A
9、.*BQW=-827-1072033-63-845>>ER=A^3ER=62723342294415714-85652608142-19062390>>BF=A.^3BF=3751272912546656-34313319261-512125>>A/Bans=3.13414.9634-0.4024-1.256112.5244-3.2317-1.98786.4512-2.0366>>EKV=BAEKV=10.7195-1.26833.52449.47561.58543.71954.8537-1.4878
此文档下载收益归作者所有