matlab 训练题目

matlab 训练题目

ID:37853957

大小:138.50 KB

页数:12页

时间:2019-06-01

matlab 训练题目_第1页
matlab 训练题目_第2页
matlab 训练题目_第3页
matlab 训练题目_第4页
matlab 训练题目_第5页
资源描述:

《matlab 训练题目》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、过程系统研究室训练资料2010.9.27内容:1.矩阵和数组的基本操作2.简单M文件程序设计3.拟合与规划3.1线性拟合3.2非线性拟合3.3单目标规划(线性、非线性)3.4多目标规划(线性、非线性)4.方程(组)求解4.1线性方程(组)的求解4.2非线性方程(组)的求解5.简单图形用户界面(GUI)设计5.1知识点5.2实例训练6.GUI进阶6.1知识点6.2实例训练7.大型系统编程1.矩阵和数组的基本操作用MATLAB产生2个矩阵A和B,其中A为4*4的魔方矩阵,B为4*4随机均匀分布的矩阵,对A和B做以下操作:(1)求

2、A*B,A+B,A/B,A.*B的值。(2)分别找出A和B元素中最大的值及其对应的位置(以A(i,j)形式表示)。[rows,cols]=find(max(max(a)))[m,ind]=max(a(:))[i,j]=ind2sub(size(a),ind)★(3)对A中的所有元素进行升序排列,并重新生成4*4的矩阵C。b=sort(a(:)),c=reshape(b,4,4)(4)删除A的最后一列得矩阵D和B的第一行得矩阵E。a(:,4)=[]…b(1,:)=[](5)将A和B连接起来,生成一个4*8的矩阵F和一个8*4的

3、矩阵Gc=[ab],,d=[a;b]2.简单的M文件程序设计(1)编写M文件,用for循环求100以内的素数。(2)编写M文件,求1000以内的所有完数。(如6=1+2+3)(3)编写M文件,求100—1000之间的水仙花数。(如4^3+0^3+7^3=407)(4)编写M文件,用while循环计算的值。(即求)(5)编写M文件,用switch语句实现百分制成绩的等级输出,90分以上为‘A’,80~90分为‘B’,70~79分为‘C’,60~69分为‘D’,60分以下为‘E’。3.拟合与规划3.1线性拟合(单变量、多变量)(

4、1)已知变量x与函数y满足关系lny=ax+lnb,且已知下列样本数据,求a,b的值。xi=[1.001.251.501.752.00];yi=[5.105.796.537.458.46];(2)已知变量x1,x2与函数y满足关系y=a0+a1x1+a2x2,已得到下列样本数据,求常数a0,a1,a2并计算出abs(y计算-y实际)。x1=[0.61.51.82.43.03.3]Tx2=[0.30.91.22.73.34.2]Ty=[0.510.780.840.690.810.72]T3.2非线性拟合(单变量、多变量)(1)

5、拟合的函数形式是y=A*x2+B*x,且A>0,B>0。其中:x=[110.3323148.7328178.064202.8258033224.7105244.5711262.908280.0447296.204311.5475];y=[5101520253035404550];(2)需要拟合的函数y=(a4*x1*x2*x3-a5*x4)*x5/(1(a0*x1)^0.5a1*x2a2*x3a3*x4)^2其中:x1=[0.03274,0.03274,0.03274,0.03556,0.03556,0.03556,0.03

6、556,0.0388,0.0388,0.0388,0.02963,0.02963,0.02963,0.02963,0.03852,0.03852,0.03852,0.0237,0.0237,0.0237,0.04741,0.04741,0.04741,0.04741,0.05333,0.05333,0.05333,0.05333,0.03556,0.03556,0.03556,0.03556,0.03556,0.03556,0.03556]';x2=[0.05686,0.05686,0.05686,0.05912,0.059

7、12,0.05912,0.05912,0.06128,0.06128,0.06128,0.04926,0.04926,0.04926,0.04926,0.06404,0.06404,0.06404,0.07882,0.07882,0.07882,0.03941,0.03941,0.03941,0.03941,0.02956,0.02956,0.02956,0.02956,0.05912,0.05912,0.05912,0.05912,0.05912,0.05912,0.05912]';x3=[3.32,2.986,2.831

8、,3.169,2.602,2.133,1.708,2.526,2.012,1.684,3.164,2.668,2.26,1.878,2.611,2.002,1.65,2.637,2.249,1.981,2.64,2.036,1.697,1.504,2.839,2.372,1.99,1.81

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。