欢迎来到天天文库
浏览记录
ID:24474430
大小:106.51 KB
页数:16页
时间:2018-11-14
《实验matlab基本操作、m文件和流程控制语句》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、实验1Matlab基本操作、M文件和流程控制语句一、实验目的1、熟悉Matlab的开发环境、熟悉Matlab中的运算符。2、掌握建立矩阵的方法,掌握相关命令操作。3、理解命令M文件和函数M文件的区别。掌握M文件的创建和运行。4、掌握流程控制语句的使用,掌握程序调试的基本方法。二、实验内容1、计算以下表达式的值,将结果按不同格式输出。掌握format命令的使用方法。(1)(2),其中(3),其中解:(1)>>y=1.3^3*sin(pi/3)*sqrt(26);>>formatlong>>yy=9.701689311661140>>fo
2、rmatshort>>yy=9.7017>>formatshorte>>yy=9.7017e+00>>formatrat>>yy=2862/295(2)>>x=[21+2*i;-0.455];>>y=1/2.*log(x+sqrt(1+x.^2));>>formatlong>>yy=0.7218177375894050.734675872184093+0.531720011788876i-0.2180248344258701.156219170636376>>formatshort>>yy=0.72180.7347+0.5317i-0
3、.21801.1562>>formatshorte>>yy=7.2182e-017.3468e-01+5.3172e-01i-2.1802e-011.1562e+00>>formatrat>>yy=397/550839/1142+813/1529i-404/18531162/1005(3)>>x=-3.0:0.1:3.0;>>y=(exp(0.3.*x)+exp(-0.3.*x))/2.*sin(x+0.3)+log((0.3+x)/2);>>formatlong>>yy=Columns1through3-0.312367695327
4、491+3.141592653589793i-0.460848694418105+3.141592653589793i-0.599180365543101+3.141592653589793iColumns4through6-0.727110604491848+3.141592653589793i-0.844523552887047+3.141592653589793i-0.951436599942239+3.141592653589793iColumns7through9-1.047997384412788+3.1415926535
5、89793i-1.134481116579716+3.141592653589793i-1.211288603813767+3.141592653589793iColumns10through12-1.278945454639893+3.141592653589793i-1.338103070443988+3.141592653589793i-1.389542235371071+3.141592653589793iColumns13through15-1.434180423553221+3.141592653589793i-1.473
6、084426144430+3.141592653589793i-1.507490676418045+3.141592653589793iColumns16through18-1.538836931516015+3.141592653589793i-1.568811151666629+3.141592653589793i-1.599427279622797+3.141592653589793iColumns19through21-1.633144766821371+3.141592653589793i-1.673062621009265
7、+3.141592653589793i-1.723247684451257+3.141592653589793iColumns22through24-1.789321830997437+3.141592653589793i-1.879593758402831+3.141592653589793i-2.007474531643163+3.141592653589793iColumns25through27-2.197440558917193+3.141592653589793i-2.503493647586021+3.141592653
8、589793i-3.096285353775532+3.141592653589793iColumns28through30-37.024482642128881-2.895719102840682-2.10382635
此文档下载收益归作者所有