预览加载中,请您耐心等待几秒...
1/7
2/7
3/7
4/7
5/7
6/7
7/7

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

上机二MATLAB数值及符号计算 一.上机目的 1.掌握MATLAB数据对象的特点以及数值、符号的运算规则。 2.掌握MATLAB中常量与变量的使用及各种表达式的书写规则。 3.掌握MATLAB常用函数的使用以及多项式的运用。 二.上机内容及结果 1求下列表达式的值: (1) 命令及结果: (2), 命令及结果: (3) (提示:注意矩阵元素相乘和矩阵相乘的区别,利用冒号“:”操作符进行赋值) 命令及结果:>>a=-3:0.1:3 a= Columns1through8 -3.0000-2.9000-2.8000-2.7000-2.6000-2.5000-2.4000-2.3000 Columns9through16 -2.2000-2.1000-2.0000-1.9000-1.8000-1.7000-1.6000-1.5000 Columns17through24 -1.4000-1.3000-1.2000-1.1000-1.0000-0.9000-0.8000-0.7000 Columns25through32 -0.6000-0.5000-0.4000-0.3000-0.2000-0.100000.1000 Columns33through40 0.20000.30000.40000.50000.60000.70000.80000.9000 Columns41through48 1.00001.10001.20001.30001.40001.50001.60001.7000 Columns49through56 1.80001.90002.00002.10002.20002.30002.40002.5000 Columns57through61 2.60002.70002.80002.90003.0000 >>z3=(exp(0.3*a)-exp(0.2*a).*sin(a+0.3)/2)+log((a+0.3)/2) z3= Columns1through5 0.8239+3.1416i0.8256+3.1416i0.8258+3.1416i0.8240+3.1416i0.8198+3.1416i Columns6through10 0.8129+3.1416i0.8026+3.1416i0.7886+3.1416i0.7703+3.1416i0.7472+3.1416i Columns11through15 0.7187+3.1416i0.6842+3.1416i0.6430+3.1416i0.5945+3.1416i0.5378+3.1416i Columns16through20 0.4720+3.1416i0.3960+3.1416i0.3083+3.1416i0.2073+3.1416i0.0905+3.1416i Columns21through25 -0.0453+3.1416i-0.2048+3.1416i-0.3954+3.1416i-0.6296+3.1416i-0.9308+3.1416i Columns26through30 -1.3520+3.1416i-2.0627+3.1416i-36.1106-2.1019-1.4295 Columns31through35 -1.0449-0.7776-0.5740-0.4096-0.2713 Columns36through40 -0.1509-0.04290.05660.15050.2412 Columns41through45 0.33060.42030.51160.60560.7034 Columns46through50 0.80570.91321.02651.14621.2725 Columns51through55 1.40571.54591.69331.84782.0092 Columns56through60 2.17732.35182.53232.71822.9090 Column61 3.1041 2.创建一个由10个元素组成的等差数列X,第一个元素是1,第10个元素是20.(提示:用linspace函数) (1)计算其元素个数; 命令及结果:>>y=linspace(1,20,10) y= Columns1through8 1.00003.11115.22227.33339.444411.555613.666715.7778 Columns9through10 17.888920.0000 (2)取出其中第二个元素赋值给y; 命令及结果:>>k=y(1,2) k= 3.1111 (3)将数组X的前三个元素分别赋值为4,5