实验一 MATLAB基本操作及运算(含实验报告)
(完整版)MATLAB)课后实验[1]
![(完整版)MATLAB)课后实验[1]](https://img.taocdn.com/s3/m/88685371e53a580217fcfe63.png)
实验一 MATLAB 运算基础1. 先求以下表达式的值,尔后显示 MATLAB 工作空间的使用情况并保存全部变量。
(1)2sin 85 z1 21 e(2) 12z ln( x 1 x ) ,其中22 x2 1 2i5(3)ae e az sin( a 0.3) ln , a 3.0, 2.9, L , 2.9, 32 22t 0 t 1(4) 2z t 1 1 t 242t 2t 1 2 t 3,其中解:M 文件:z1=2*sin(85*pi/180)/(1+exp(2))x=[2 1+2*i;-.45 5];z2=1/2*log(x+sqrt(1+x^2))a=-3.0:0.1:3.0;z3=(exp(0.3.*a)-exp(-0.3.*a))./2.*sin(a+0.3)+log((0.3+a)./2)t=0:0.5:2.5;z4=(t>=0&t<1).*(t.^2)+(t>=1&t<2).*(t.^2-1)+(t>=2&t<3) .*(t.^2-2*t+1)4. 完成以下操作:(1) 求[100,999] 之间能被 21 整除的数的个数。
(2) 建立一个字符串向量,删除其中的大写字母。
解:(1) 结果:m=100:999;n=find(mod(m,21)==0);length(n)ans =43(2). 建立一个字符串向量比方:ch='ABC123d4e56Fg9'; 那么要求结果是:ch='ABC123d4e56Fg9';k=find(ch>='A'&ch<='Z');ch(k)=[]ch =123d4e56g9实验二 MATLAB矩阵解析与办理1. 设有分块矩阵 A E R3 3 3 2O S2 3 2 2,其中 E、R、O、S 分别为单位矩阵、随机矩阵、零矩阵和对角阵,试经过数值计算考据 2A E R RS2O S。
实验一MATLAB的基本操作

桂林电子科技大学
数学与计算科学学院实验报告
命令输入方式
在命令窗口>>符号后面输入命令。
一般来说,一个命令行输入一条命令,命令行以回车结束。
但一个命令行也可以输入若干条命令,各命令之间以逗号分隔。
若前一命令后带有分号,则逗号可以省略,此时只显示最后一条命令的执行结果。
例如,
4.学会使用MATLAB的帮助功能
使用MATLAB的帮助功能可以通过主窗口中的Help菜单项,或者在命令窗口中输入helpwin
帮助页面左边为帮助向导,右边为对应的帮助项。
在帮助向导页面中包含4个可供选择选项选项卡用来查看帮助的主题;Index选项卡根据指定的关键词进行查找;Search Results 选项卡查找指定的单词;DeMos选项卡查看和运行MATLAB的演示程序。
的变量和数据操作
7.MATLAB的矩阵及其基本运算矩阵的生成:
5.冒号表达式矩阵的拆分:
矩阵的算术运算:矩阵运算常用函数常用的数学函数
逻辑运算:。
Matlab基础运用实验报告1

(黑体3号)实验报告(黑体3号)课程:Matlab基础运用班级:姓名:学号成绩:指导教师:实验日期及时间:2009.9.16座位号:必修/选修:实验序号:实验名称:(标题均为黑体小4号)一、实验目的与要求:实验目的:Matlab是功能强大的科学及工程计算软件。
是以矩阵计算为基础的计算工具,本次实验通过学生对Matlab运行环境的熟悉和一些简单操作,掌握帮助命令、绘图命令以及矩阵操作等使用方法。
实验要求:1.上机结束时须经指导老师检查实验结果后方可离开。
2.课代表在实验后三天内将实验报告收齐交指导老师。
二、实验原理、内容和步骤(一)Matlab界面和矩阵运算基础1,建立自己的工作目录,将该目录设为当前目录,并将其设置成MATLAB的搜索路径。
2,熟悉Matlab的帮助功能。
采用两种方式获得关于函数“exp”的解释。
(1)利用Help Browser.(2)在Command Window下通过输入命令“help exp”。
(3)利用Help navigator3,从屏幕上输入矩阵A=[1 2 3;4 5 6;7 8 9]或A=[1,2,3;4,5,6;7,8,9]观察输出结果;试用回车代替分号,观察输出结果;4,选择File|new菜单中的M-file,输入B=[9 ,8,7;6,5,4;3,2,1],保存为tmp.m文件,退出编辑环境。
此时在工作环境中使用tmp命令就可调出B矩阵;5,输入who和whos观察结果,了解其作用;6,用至少两种方式创建以下矩阵。
A=⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡987654321>>a=[1 2 3;4 5 6;7 8 9]a =1 2 34 5 67 8 9或使用以下命令调用>> tmpa =1 2 34 5 67 8 9>>a=[1:3;4:6;7:9]a =1 2 34 5 67 8 9(二)基本绘图1, 绘制 sin (1/t), -1<t<1,标上坐标轴和标题.。
Matlab实验报告

实 验 内 容
<设计性实验> 1、对于连续信号 x(t)=1+cos(2πft),其中 f=5kHz,分别以采样频率 fs=6 kHz 和 fs=12kHz 对其 进行采样, (1)分别绘出对应的采样信号。 (2)对信号进行傅里叶变换,绘出对应的曲线。 (3)在 simulink 仿真环境下,设计系统框图,观察信号的频谱成分。 实验源程序: (1)采样 clear all; fs1=6000;fs2=12000;f=5000; dt1=1/fs1;dt2=1/fs2; t=0:0.00001:0.0005;t1=0:dt1:0.005;t2=0:dt2:0.0025; x_t=1+cos(2*pi*f*t); x_t1=1+cos(2*pi*f*t1); x_t2=1+cos(2*pi*f*t2); figure(1) subplot(3,1,1) plot(t,x_t); title('原始信号') subplot(3,1,2) plot(t1,x_t1); title('采样频率 6kHZ 的采样信号') subplot(3,1,3) plot(t2,x_t2); title('采样频率 12kHZ 的采样信号') xlabel('时间/s')
3、lpf 函数 function [t,st]=lpf(f,sf,B); df = f (2) - f (1); T = 1/df; hf = zeros(1,length(f)); bf = [ -floor(B/df):floor(B/df)] + floor(length(f)/2); hf(bf) = 1; yf = hf.*sf; [t,st]=F2T(f,yf); st = real(st);
Matlab实验报告(1)

《Matlab语言与应用》课程实验报告*名:**班级:电信114学号:************指导老师:***二〇一三年十一月二十一日Matlab实验报告实验一一、实验问题求[12 + sin(2)×( 22 −4)]÷3^2的算术运算结果。
二、问题的分析该题主要熟悉Matlab环境下的对数学运算的熟悉,如何输入数据、建立函数输出结果。
三、上机实验结果如图四、实验的总结与体会通过本次实验,我学会了用Matlab来计算数学运算中的复杂技术。
我们也可以自己编写一个可以调用的函数,首先我们要了解Matlab语言函数的基本结构,结构如下:Function [返回变量列表]=函数名(输入变量列表)注释说明语句段,由%引导输入、返回变量格式的检测函数体语句例如:输入变量为k,返回的变量为m和s,其中s为前m项的和Function [m,s]=findsum(k)s=0;m=0;while(s<=k),m=m+1;s=s+m;end编写了函数,就可以将其存为findsum.m文件,这样就可以在Matlab环境中对不同的k值调用该函数了。
这样就可以灵活的实现我们想要的数据。
实验二一、实验问题二、问题分析输入矩阵时,空格或逗号表示间隔,分号表示换行,比如上面的矩阵A应写为A=[1,2,3;4,5,6;7,8,9]三、上机实验结果如图四、实验的总结与体会通过对本次上机实验了解到在Matlab中对矩阵的代数运算矩阵转置、矩阵的加减法运算、矩阵乘法、矩阵的左、右除、矩阵翻转、矩阵乘方运算、点运算等。
实验三一、实验要求画图,理解plot函数用法二、代码如下clear; clf;t=0:pi/20:2*pi;R=5;x=R*sin(t); y=R*cos(t);plot(x,y,'b:'), gridhold onrrr=[x;y;x+y];plot(rrr(1,:),'.','MarkerSize',10,'Color','r')plot(rrr(2,:),rrr(3,:),'o','MarkerSize',15,'Color','b'); axis([-8,20,-8,8]), % axis squarehold off三、Matlab运行结果如图实验四一、实验要求二、代码如下t=0:pi/50:4*pi;y0=exp(-t/3);y=exp(-t/3).*sin(3*t);plot(t,y,'-r',t,y0,':b',t,-y0,':b') Grid三、Matlab运行结果如图实验五一、实验要求傅里叶频谱分析二、代码及分析(1)首先生成数据,包含50Hz和120Hz频率的正弦波x >>t = 0:.001:.25;>>x = sin(2*pi*50*t) + sin(2*pi*120*t);(2)再生成噪音信号yy = x + 2*randn(size(t));plot(y(1:50))title('Noisy time domain signal')(3)对y进行快速傅里叶变换Y = fft(y,256);(4)计算功率谱Pyy = Y.*conj(Y)/256;f = 1000/256*(0:127);plot(f,Pyy(1:128))title('Power spectral density')xlabel('Frequency (Hz)')(5)只查看200Hz以下频率段plot(f(1:50),Pyy(1:50))title('Power spectral density')xlabel('Frequency (Hz)')三、上机结果如下图实验六一、实验要求FIR数字滤波器设计代码如下clear;close allf=[0,0.6,0.6,1]; m=[0,0,1,1]; % 设定预期幅频响应b=fir2(30,f,m); n=0:30; % 设计FIR 数字滤波器系数subplot(3,2,1),stem(n,b,'.')xlabel('n'); ylabel('h(n)');axis([0,30,-0.4,0.5]),line([0,30],[0,0])[h,w]=freqz(b,1,256);subplot(3,2,2),plot(w/pi,20*log10(abs(h)));gridaxis([0,1,-80,0]),xlabel('w/pi'); ylabel('幅度(dB)');二、上级结果如图实验七二、实验要求用guide实验一个简单的加减乘除计算器二、实验步骤在命令行输入guide命令,进入guide界面新建一个空白guide文件在空白文件中设置好功能模块如图模块建立好后,就要把编写好的加减乘除代码加入到各自的回调函数中,见下图两个被加数代码如下图加模块代码如下图减模块代码如下图乘模块代码如下图除模块代码如下图各模块的回调函数加完后就可以运行了,运行结果如下图总结:Matlab一个高级的距阵/阵列语言,它包含控制语句、函数、数据结构、输入和输出和面向对象编程特点。
MATLAB基本操作

实验一MATLAB基本操作实验实验目的:1.掌握Matlab软件使用的基本方法;2.熟悉Matlab的数据表示、基本运算和程序控制语句;3.熟悉Matlab绘图命令及基本绘图控制;4.熟悉Matlab程序设计的基本方法。
实验装置:计算机实验原理及内容:1.1基本规则1.1.1 一般MATLAB命令格式为[输出参数1,输出参数2,……]=(命令名)(输入参数1,输入参数2,……)输出参数用方括号,输入参数用圆括号如果输出参数只有一个可不使用括号。
1.1.2 %后面的任意内容都将被忽略,而不作为命令执行。
1.1.3 可用↑、↓键来重现已输入的数据或命令。
用←、→键来移动光标进行修改。
1.1.4所有MATLAB命令都用小写字母。
大写字母和小写字母分别表示不同的变量。
1.1.5常用数有特定的名字,如pi(=3.141596)、Inf(=∞)、NaN则表示不定型求得的结果(如0/0)。
1.1.6矩阵的输入要一行一行的进行,每行各元素用空格或(,)分开,每行用(;)分开。
如1 2 3A= 4 5 67 8 9MATLAB书写格式为A=[1 2 3 ;4 5 6 ;7 8 9]在MATLABZ中运行如下程序可得到A矩阵a=[1 2 3;4 5 6;7 8 9]a =1 2 34 5 67 8 91.1.7 需要显示命令的计算结果时,则语句后面不加“;”号,否则要加“;”号。
运行下面两种格式可以看出他们的区别a=[1 2 3;4 5 6;7 8 9] a=[1 2 3;4 5 6;7 8 9];a = (不显示计算结果)1 2 34 5 67 8 91.1.8 当输入语句过长需要换行时,应加上“…”后再回车,则可连续输入。
1.2 文件管理常用命令1.2.1 帮助(HELP)命令MATLAB有很多命令,因此很不容易记忆。
使用HELP命令可以得到有关命令的屏幕帮助信息。
如在MATLAB环境下直接运行HELP命令就会在屏幕上给出MATLAB的基本命令以及相关的工具箱软件命令(请同学自行验证)。
MATLAB实验报告

MATLAB实验报告MATLAB 实验报告姓名:专业:学号:实验⼀ MATLAB环境的熟悉与基本运算⼀、实验⽬的:1.熟悉MATLAB开发环境2.掌握矩阵、变量、表达式的各种基本运算⼆、实验基本知识:1.熟悉MATLAB环境:MATLAB桌⾯和命令窗⼝、命令历史窗⼝、帮助信息浏览器、⼯作空间浏览器⽂件和搜索路径浏览器。
2.掌握MATLAB常⽤命令3.MATLAB变量与运算符变量命名规则如下:(1)变量名可以由英语字母、数字和下划线组成(2)变量名应以英⽂字母开头(3)长度不⼤于31个(4)区分⼤⼩写MATLAB中设置了⼀些特殊的变量与常量,列于下表。
MATLAB运算符,通过下⾯⼏个表来说明MATLAB的各种常⽤运算符表2 MATLAB算术运算符表3 MATLAB关系运算符表4 MATLAB逻辑运算符表5 MATLAB特殊运算4.MATLAB的⼀维、⼆维数组的寻访表6 ⼦数组访问与赋值常⽤的相关指令格式5.MATLAB的基本运算表7 两种运算指令形式和实质内涵的异同表6.MATLAB的常⽤函数表8 标准数组⽣成函数表9 数组操作函数三、实验内容1、学习安装MATLAB软件。
2、学习使⽤help命令,例如在命令窗⼝输⼊help eye,然后根据帮助说明,学习使⽤指令eye(其它不会⽤的指令,依照此⽅法类推)3、学习使⽤clc、clear,观察command window、command history和workspace 等窗⼝的变化结果。
4、初步程序的编写练习,新建M-file,保存(⾃⼰设定⽂件名,例如exerc1、exerc2、exerc3……),学习使⽤MATLAB的基本运算符、数组寻访指令、标准数组⽣成函数和数组操作函数。
注意:每⼀次M-file的修改后,都要存盘。
四、实验结果练习A:(1)help rand,然后随机⽣成⼀个2×6的数组,观察command window、command history和workspace等窗⼝的变化结果。
MATLAB全部实验及答案

MATLAB全部实验及答案MATLAB全部实验及答案实验一、MATLAB基本操作实验内容及步骤4、有关向量、矩阵或数组的一些运算(1)设A=15;B=20;求C=A+B与c=a+b?(2)设A=[1 2 3;4 5 6;7 8 9],B=[9 8 7;6 5 4;3 2 1];求A*B 与A.*B?A*B就是线代里面的矩阵相乘A.*B是对应位置的元素相乘(3)设a=10,b=20;求i=a/b=0.5与j=a\b=2?(4)设a=[1 -2 3;4 5 -4;5 -6 7]请设计出程序,分别找出小于0的矩阵元素及其位置(单下标、全下标的形式),并将其单下标转换成全下标。
clear,clca=[1 -2 3;4 5 -4;5 -6 7];[x,y]=find(a<0);c=[];for i=1:length(x)c(i,1)=a(x(i),y(i));c(i,2)=x(i);c(i,3)=y(i);c(i,4)=(y(i)-1)*size(a,2)+x(i);endc(5)在MATLAB命令行窗口运行A=[1,2;3,4]+i*[5,6;7,8];看结果如何?如果改成运行A=[1,2;3,4]+i[5,6;7,8],结果又如何?前面那个是虚数矩阵,后面那个出错(6)请写出完成下列计算的指令:a=[1 2 3;3 4 2;5 2 3],求a^2=?,a.^2=?a^2= 22 16 1625 26 2326 24 28a.^2=1 4 99 16 425 4 9(7)有一段指令如下,请思考并说明运行结果及其原因clearX=[1 2;8 9;3 6];X( : ) 转化为列向量(8)使用三元组方法,创建下列稀疏矩阵2 0 8 00 0 0 10 4 0 06 0 0 0方法一:clear,clcdata=[2 8 1 4 6];ir=[1 1 2 3 4 ];jc=[1 3 4 2 1];s=sparse(ir,jc,data,4,4);full(s)方法二:不用三元组法clear,clca=zeros(4,4);a(1,[1,3])=[2,8];a(2,4)=1;a(3,2)=4;a(4,1)=6;a(9)写出下列指令的运行结果>> A = [ 1 2 3 ]; B = [ 4 5 6 ];>> C = 3.^A>> D = A.^B5、已知+?=-334sin 234πt e y t 若需要计算t ∈[-1,1],取间隔为0.01,试计算出相对应的y 值。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
实验一 MATLAB 基本操作及运算一、 实验目的1、 理解Matlab 数据对象的特点;2、 掌握基本Matlab 运算规则;3、 掌握Matlab 帮助的使用方法;二、 实验的设备及条件计算机一台(带有MATLAB7.0以上的软件环境)。
三、 实验内容要求建立一个名为experiment01.m 的,把与实验内容1-7相关的实验命令都放入该文件中,题与题之间用相应注释分割。
注意对实验中出现的相关函数或变量,请使用help 或doc 查询相关帮助文档,学习函数的用法。
1、 建立以下标量:1) a=102) b=2.5×10233) c=2+3i ,(i 为虚数单位)4) d=3/2πj e ,(j 为虚数单位,这里要用到exp ,pi )2、 建立以下向量:1) aVec=[3.14 15 9 26]2) bVec=⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎣⎡18228871.2 3) cVec=[5 4.8 … -4.8 -5 ] (向量中的数值从5到-5,步长为-0.2)4) dVec=[100 100.01 … 100.99 101] (产生1到10之间的等对数间隔向量,参考logspace ,注意向量的长度)3、 建立以下矩阵:1)⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=2222 aMat aMat 一个9×9的矩阵,其元素全为2;(参考ones 或zeros )2)⎥⎥⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎢⎢⎣⎡=1000005000001 bMat bMat 是一个9×9的矩阵,除主对角上的元素为[1 2 3 4 5 4 3 2 1]外,其余元素均为0。
(参考diag )。
3)10020109212291111=cMatcMat 为一个10×10的矩阵,可有1:100的向量来产生(参考reshape )4)⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=NaN NaN NaN NaN NaN NaN NaN NaNNaN NaN NaN NaNdMatdMat 为3×4的NaN 矩阵,(参考nan )5)⎥⎦⎤⎢⎣⎡---=8710225113eMat 6)产生一个5×3随机整数矩阵fMat ,其值的范围在-3到3之间。
(参考rand 和floor 或ceil )4、 使用题1中的变量计算下列等式的x,y,z 的值:1) )6/)15((11--+=a e x 2) g g h h b a y /121,)(=+=提示π,参考sqrt 。
3) cc ad c d c R z ))3/sin()]))([(log(π-+=,其中R 表示取括号内复数的实数部分,c 表示c 的共轭复数,log 是自然对数。
(参考real ,conj ,log )5、 使用题2中的向量求解一下等式: 1))25.2/(2225.221cVec e xVec -=π,其中cVec 指的是题2 中定义的向量cVec ,一下雷同。
2)22)(bVec aVec yVec T +=,T aVec 表示aVec 的转置3))/1(log 10dVec zVec =,10log 表示已10为底的对数,参考log106、 使用题2和题3中所产生的向量和矩阵计算以下等式,注意本题的操作均采用矩阵间的运算。
1)2)(aMat bVec aVec xMat ⋅⋅=2)aVec bVec yMat ⋅=,注意这里与bVec aVec ⋅是不一样的3)TbMat aMat cMat zMat )(⋅=,这里cMat 为cMat 所对应行列式的值,参考det 。
7、 函数的使用和矩阵的访问。
1) 计算矩阵cMat 每一列的和,结果应为行向量形式。
(参考sum )2) 计算eMat 每一行的平均值,结果应为列向量形式。
(参考mean )3) 用向量[1 1 1] 替换eMat 的最上一行的值4) 将cMat 的第2~9行,第2到9列的元素所构成的矩阵赋值给cSub 。
5) 使用函数rand 产生一个1×5的向量r ,并将r 中值小于0.5的元素设置为0。
(参考find )四、实验报告要求(包含预习报告要求和最终报告要求)1.实验名称2.实验目的3.实验设备及条件4.实验内容及要求5.实验程序设计指程序代码。
6.实验结果及结果分析实验结果要求必须客观,有数据的可以记录数据,没有数据的简单描述实验现象。
结果分析是对实验结果的理论评判。
7.实验中出现的问题及解决方法8. 思考题的回答四、 实验报告的提交方式Word 文档,命名方式:实验号_你的学号_姓名;例如本次实验:实验一_000000001_张三.docE_mail: matlab_xx01@下一次课前提交,过期不收!五、 参考文献预习报告要求 最终报告要求参考教材和Matlab帮助文件。
1.实验名称MATLAB基本操作及运算2.实验目的(1)理解Matlab数据对象的特点;(2)掌握基本Matlab运算规则;(3)掌握Matlab帮助的使用方法;3.实验设备及条件计算机一台(带有MATLAB7.0以上的软件环境)4.实验内容及要求要求建立一个名为experiment01.m的,把与实验内容1-7相关的实验命令都放入该文件中,题与题之间用相应注释分割。
注意对实验中出现的相关函数或变量,请使用help或doc查询相关帮助文档,学习函数的用法。
5.实验程序设计clcformat compactformat long g%1.1A=10%1.2b=2.5*10^23%1.3c=2+3*id=exp((j*2*pi)/3)%2.1aVec=[3.14 15 9 26]%2.2bVec=[2.71 8 28 182]'%2.3cVec=[5:-0.2:-5]%2.4dVec=logspace(0,1,100)%3.1aMat=2*ones+zeros(9)%3.2bMat=diag([1,2,3,4,5,4,3,2,1])%3.3x=[1:1:100]cMat=reshape(x,10,10)%3.4dMat=zeros(3,4)+nan%3.5eMat=[13,-1,5;-22,10,-87]fMat=unifrnd(-2,5,4,3)%4.1x=1/(1+exp(-(A-15)/6))%4.2y=(sqrt(A)+b^(1/21))^pi%4.3z=(log(real((c+d)*(c-d))*sin(A*pi/3)))/(c*conj(c))%5.1xVec=exp(-cVec.^2/2.25^2)/sqrt(2*pi*2.5^2)%5.2yVec1=sqrt((aVec').^2/2+bVec.^2)%5.3zVec=log10(1./dVec)%6.1xMat=(aVec*bVec)*aMat.^2%6.2yMat=bVec*aVec%6.3zMat=det(cMat)*(aMat*bMat)'%7.1cMat_sum=sum(cMat,2)%7.2eMat_mean=mean(eMat,2)%7.3eMat_replace=eMat./[eMat(1,:);ones(1,3)]%7.4cSub=cMat(cMat(2:9,:))%7.5fina=rand(5,1)fina1=find(fina<0.5)fina(fina1)=06.实验结果及结果分析第一大题A =10b =2.5e+023c =2 + 3id =-0.5 + 0.866025403784439i_____________________________________________________________________ 第二大题aVec =Columns 1 through 23.14 15 Columns 3 through 49 26 bVec =2.71828182cVec =Columns 1 through 25 4.8 Columns 3 through 44.6 4.4 Columns 5 through 64.2 4 Columns 7 through 83.8 3.6 Columns 9 through 103.4 3.2 Columns 11 through 123 2.8 Columns 13 through 142.6 2.4 Columns 15 through 162.2 2 Columns 17 through 181.8 1.6 Columns 19 through 201.4 1.2Columns 21 through 221 0.8 Columns 23 through 240.6 0.399999999999999 Columns 25 through 260.199999999999999 0 Columns 27 through 28-0.199999999999999 -0.399999999999999 Columns 29 through 30-0.6 -0.8 Columns 31 through 32-1 -1.2 Columns 33 through 34-1.4 -1.6 Columns 35 through 36-1.8 -2 Columns 37 through 38-2.2 -2.4 Columns 39 through 40-2.6 -2.8 Columns 41 through 42-3 -3.2 Columns 43 through 44-3.4 -3.6 Columns 45 through 46-3.8 -4 Columns 47 through 48-4.2 -4.4 Columns 49 through 50-4.6 -4.8 Column 51-5dVec =Columns 1 through 21 1.02353102189903 Columns 3 through 41.04761575278966 1.07226722201032 Columns 5 through 61.09749876549306 1.12332403297803 Columns 7 through 81.14975699539774 1.176811952435 Columns 9 through 101.20450354025878 1.23284673944207 Columns 11 through 121.26185688306602 1.29154966501488 Columns 13 through 141.32194114846603 1.35304777457981 Columns 15 through 161.38488637139387 1.41747416292681 Columns 17 through 181.45082877849594 1.48496826225447 Columns 19 through 201.51991108295293 1.55567614393047 Columns 21 through 221.59228279334109 1.62975083462064 Columns 23 through 241.66810053720006 1.70735264747069 Columns 25 through 261.74752840000768 1.78864952905743 Columns 27 through 281.83073828029537 1.87381742286038 Columns 29 through 301.91791026167249 1.96304065004027 Columns 31 through 322.00923300256505 2.05651230834865 Columns 33 through 342.10490414451202 2.15443469003188 Columns 35 through 362.20513073990305 2.25701971963392 Columns 37 through 382.31012970008316 2.36448941264541 Columns 39 through 402.42012826479438 2.47707635599171 Columns 41 through 422.53536449397011 2.59502421139974 Columns 43 through 442.65608778294669 2.71858824273294 Columns 45 through 462.78255940220712 2.8480358684358 Columns 47 through 482.91505306282518 2.98364724028334 Columns 49 through 503.05385550883342 3.12571584968824 Columns 51 through 523.19926713779738 3.27454916287773 Columns 53 through 543.35160265093884 3.43046928631492 Columns 55 through 563.51119173421513 3.59381366380463 Columns 57 through 583.67837977182863 3.76493580679247 Columns 59 through 603.85352859371053 3.94420605943766Columns 61 through 624.03701725859655 4.13201240011534 Columns 63 through 644.2292428743895 4.32876128108306 Columns 65 through 664.43062145758388 4.53487850812858 Columns 67 through 684.64158883361278 4.7508101621028 Columns 69 through 704.86260158006535 4.97702356433211 Columns 71 through 725.09413801481638 5.21400828799968 Columns 73 through 745.33669923120631 5.46227721768434 Columns 75 through 765.59081018251222 5.72236765935022 Columns 77 through 785.85702081805667 5.99484250318941 Columns 79 through 806.13590727341317 6.28029144183425 Columns 81 through 826.42807311728432 6.57933224657568 Columns 83 through 846.73415065775082 6.8926121043497 Columns 85 through 867.05480231071864 7.22080901838546 Columns 87 through 887.39072203352578 7.56463327554629 Columns 89 through 907.74263682681127 7.92482898353917 Columns 91 through 928.11130830789687 8.30217568131975Columns 93 through 948.49753435908644 8.69749002617784Columns 95 through 968.90215085445039 9.11162756115489Columns 97 through 989.3260334688322 9.54548456661834Columns 99 through 1009.77009957299225 10_____________________________________________________________________ 第三大题aMat =2 2 2 2 2 2 2 2 22 2 2 2 2 2 2 2 22 2 2 2 2 2 2 2 22 2 2 2 2 2 2 2 22 2 2 2 2 2 2 2 22 2 2 2 2 2 2 2 22 2 2 2 2 2 2 2 22 2 2 2 2 2 2 2 22 2 2 2 2 2 2 2 2bMat =1 0 0 0 0 0 0 0 00 2 0 0 0 0 0 0 00 0 3 0 0 0 0 0 00 0 0 4 0 0 0 0 00 0 0 0 5 0 0 0 00 0 0 0 0 4 0 0 00 0 0 0 0 0 3 0 00 0 0 0 0 0 0 2 0x =Columns 1 through 91 2 3 4 5 6 7 8 9 Columns 10 through 1810 11 12 13 14 15 16 17 18 Columns 19 through 2719 20 21 22 23 24 25 26 27 Columns 28 through 3628 29 30 31 32 33 34 35 36 Columns 37 through 4537 38 39 40 41 42 43 44 45 Columns 46 through 5446 47 48 49 50 51 52 53 54 Columns 55 through 6355 56 57 58 59 60 61 62 63 Columns 64 through 7264 65 66 67 68 69 70 71 72 Columns 73 through 8173 74 75 76 77 78 79 80 81 Columns 82 through 9082 83 84 85 86 87 88 89 90 Columns 91 through 9991 92 93 94 95 96 97 98 99 Column 100100cMat =Columns 1 through 91 11 21 31 41 51 61 71 812 12 22 32 42 52 62 72 823 13 23 33 43 53 63 73 835 15 25 35 45 55 65 75 856 16 26 36 46 56 66 76 867 17 27 37 47 57 67 77 878 18 28 38 48 58 68 78 889 19 29 39 49 59 69 79 8910 20 30 40 50 60 70 80 90 Column 10919293949596979899100dMat =NaN NaN NaN NaNNaN NaN NaN NaNNaN NaN NaN NaNeMat =13 -1 5-22 10 -87fMat =Columns 1 through 24.65090499603023 4.23909276304231 -0.382030404979985 3.33467783119176 2.24789808479251 1.19527365617839 1.4018772809651 -1.87047449726243Column 33.749850150066771.112923550472362.308026436700663.54355926198925_____________________________________________________________________ 第四大题x =0.302940716034593y =6269.60314420271z =0.104633566196183_____________________________________________________________________ 第五大题xVec =Columns 1 through 20.0011436837460341 0.00168440923977891Columns 3 through 40.00244189145989572 0.00348451366324844Columns 5 through 60.004894350444668 0.00676682628990691Columns 7 through 80.00920899141861331 0.0123360517753163Columns 9 through 100.0162658728660145 0.0211113321391906Columns 11 through 120.026970622986521 0.033915903649967Columns 13 through 140.0419810099474893 0.0511492707968797Columns 15 through 160.061342728003881 0.0724142104534477 Columns 17 through 180.0841436968344532 0.096240185732909 Columns 19 through 200.10834986912344 0.120070800079053 Columns 21 through 220.130973517949181 0.14062633423639 Columns 23 through 240.148623297923735 0.154612359137343 Columns 25 through 260.158321025606789 0.159576912160573 Columns 27 through 280.158321025606789 0.154612359137343 Columns 29 through 300.148623297923735 0.14062633423639 Columns 31 through 320.130973517949181 0.120070800079053 Columns 33 through 340.10834986912344 0.096240185732909 Columns 35 through 360.0841436968344532 0.0724142104534477 Columns 37 through 380.061342728003881 0.0511492707968797 Columns 39 through 400.0419810099474893 0.033915903649967 Columns 41 through 420.026970622986521 0.0211113321391906 Columns 43 through 440.0162658728660145 0.0123360517753163 Columns 45 through 460.00920899141861331 0.00676682628990691 Columns 47 through 480.004894350444668 0.00348451366324844 Columns 49 through 500.00244189145989572 0.00168440923977891 Column 510.0011436837460341yVec1 =3.5034126220015813.285330255586428.7141080307225182.926214633114zVec =Columns 1 through 20 -0.0101010101010101 Columns 3 through 4-0.0202020202020202 -0.0303030303030304 Columns 5 through 6-0.0404040404040404 -0.0505050505050505 Columns 7 through 8-0.0606060606060606 -0.0707070707070707 Columns 9 through 10-0.0808080808080809 -0.0909090909090909 Columns 11 through 12-0.101010101010101 -0.111111********* Columns 13 through 14-0.121212********* -0.131313131313131 Columns 15 through 16-0.141414141414141 -0.151515151515152 Columns 17 through 18-0.161616161616162 -0.171717171717172Columns 19 through 20-0.181818181818182 -0.191919191919192 Columns 21 through 22-0.202020202020202 -0.212121212121212 Columns 23 through 24-0.222222222222222 -0.232323232323232 Columns 25 through 26-0.242424242424242 -0.252525252525253 Columns 27 through 28-0.262626262626263 -0.272727272727273 Columns 29 through 30-0.282828282828283 -0.292929292929293 Columns 31 through 32-0.303030303030303 -0.313131313131313 Columns 33 through 34-0.323232323232323 -0.333333333333333 Columns 35 through 36-0.343434343434343 -0.353535353535354 Columns 37 through 38-0.363636363636364 -0.373737373737374 Columns 39 through 40-0.383838383838384 -0.393939393939394 Columns 41 through 42-0.404040404040404 -0.414141414141414 Columns 43 through 44-0.424242424242424 -0.434343434343434 Columns 45 through 46-0.444444444444444 -0.454545454545455 Columns 47 through 48-0.464646464646465 -0.474747474747475 Columns 49 through 50-0.484848484848485 -0.494949494949495 Columns 51 through 52-0.505050505050505 -0.515151515151515 Columns 53 through 54-0.525252525252525 -0.535353535353535 Columns 55 through 56-0.545454545454545 -0.555555555555556 Columns 57 through 58-0.565656565656566 -0.575757575757576 Columns 59 through 60-0.585858585858586 -0.595959595959596 Columns 61 through 62-0.606060606060606 -0.616161616161616 Columns 63 through 64-0.626262626262626 -0.636363636363636 Columns 65 through 66-0.646464646464647 -0.656565656565657 Columns 67 through 68-0.666666666666667 -0.676767676767677 Columns 69 through 70-0.686868686868687 -0.696969696969697 Columns 71 through 72-0.707070707070707 -0.717171717171717 Columns 73 through 74-0.727272727272727 -0.737373737373737 Columns 75 through 76-0.747474747474747 -0.757575757575758 Columns 77 through 78-0.767676767676768 -0.777777777777778 Columns 79 through 80-0.787878787878788 -0.797979797979798-0.808080808080808 -0.818181818181818 Columns 83 through 84-0.828282828282828 -0.838383838383838 Columns 85 through 86-0.848484848484848 -0.858585858585859 Columns 87 through 88-0.868686868686869 -0.878787878787879 Columns 89 through 90-0.888888888888889 -0.898989898989899 Columns 91 through 92-0.909090909090909 -0.919191919191919 Columns 93 through 94-0.929292929292929 -0.939393939393939 Columns 95 through 96-0.94949494949495 -0.95959595959596 Columns 97 through 98-0.96969696969697 -0.97979797979798 Columns 99 through 100-0.98989898989899 -1 xMat =Columns 1 through 220450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.037620450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 Columns 5 through 620450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 Columns 7 through 820450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 20450.0376 Column 920450.037620450.037620450.037620450.037620450.037620450.037620450.037620450.037620450.0376yMat =Columns 1 through 28.5094 40.65 25.12 120 87.92 420 571.48 2730 Columns 3 through 424.39 70.46 72 208 252 728 1638 4732 zMat =0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cMat_sum =470480490500510520530540550eMat_mean =5.66666666666667-33eMat_replace =1 1 1-22 10 -87cSub =Columns 1 through 92 12 22 32 42 52 62 72 823 13 23 33 43 53 63 73 834 14 24 34 44 54 64 74 845 15 25 35 45 55 65 75 856 16 26 36 46 56 66 76 867 17 27 37 47 57 67 77 878 18 28 38 48 58 68 78 889 19 29 39 49 59 69 79 89 Column 1092939495979899fina =0.9218129707448030.7382072458106650.1762661444946180.4057062130620950.935469699107605fina1 =34fina =0.9218129707448030.7382072458106650.9354696991076057.实验中出现的问题及解决方法问题:题3.6中,仅依靠提示所给的参考函数rand、floor或ceil,很难解决问题。