matlab程序设计实验报告范文
matlab程序设计实验报告
篇一:Matlab编程实验报告 中北大学 Matlab编程实验报告 班 级 姓 名: 学 号: XX 年 11 月 2,实验一 Matlab运算基础 一、实验目的 1、熟悉启动和退出MATLAB的方法。 2、熟悉MATLAB工作窗口的组成。 3、掌握建立矩阵的方法,矩阵分析与处理。 4、掌握MATLAB各种表达式的书写规则以及常用函数的使用。 二、实验内容 1. 先求下列表达式的值,然后显示MATLAB工作空间的使用情况并保存全部变量。 (1)z1? 2sin85? 1?e2 z1=2*sin(85*pi/180)/(1+exp(2)) z1 = 0.2375 ?21(2 )z2?ln(x?,其中x?? 2??0.45 x=[2,1+2*i;-0.45,5] x = 2.0000 1.0000 + 2.0000i-0.4500 5.0000 z2=1/2*log(x+sqrt(1+x*x)) z2 = 0.7114 - 0.0253i0.8968 + 0.3658i 0.2139 + 0.9343i1.1541 - 0.0044i 1?2i? 5?? e0.3a?e?0.3a (3)z3??sin(a?0.3),a??3.0,?2.9,?2.8,?,2.8,2.9,3.0 2 提示:利用冒号表达式生成a向量,求各点的函数值时用点乘运算。 a=-3.0:0.1:3.0 a = Columns 1 through 9 -3.0000-2.9000-2.8000-2.7000-2.6000-2.5000-2.4000 -2.XX Columns 10 through 18 -2.1000-2.0000-1.9000-1.8000-1.7000-1.6000-1.5000 -1.3000 Columns 19 through 27 -1.XX-1.1000-1.0000-0.9000-0.8000-0.7000-0.6000 -0.4000 Columns 28 through 36 -0.3000-0.XX-0.10000 0.1000 0.XX 0.4000 0.5000 Columns 37 through 45 0.6000 0.7000 0.8000 0.9000 1.0000 1.1000 1.3000 1.4000 Columns 46 through 54 1.5000 1.6000 1.7000 1.8000 1.9000 2.0000 2.XX 2.3000 Columns 55 through 61 2.4000 2.5000 2.6000 2.7000 2.8000 2.9000 3.0000 -2.3000 -1.4000 -0.5000 0.3000 1.XX 2.1000 >> z3=(exp(0.3.*a)-exp(-0.3.*a))/2.*sin(a+0.3) z3 = Columns 1 through 9 0.4387 0.5072 0.5640 0.6089 0.6424 0.6648 0.6766 0.6784 0.6709 Columns 10 through 18 0.6549 0.6313 0.6011 0.5652 0.52470.3854 0.3366 Columns 19 through 27 0.2881 0.2410 0.1962 0.1543 0.11620.0299 0.0120 Columns 28 through 36 -0.0000-0.0060-0.00600 0.01170.0775 0.1080 Columns 37 through 45 0.1418 0.1780 0.2159 0.2547 0.29340.3998 0.4289 Columns 46 through 54 0.4532 0.4719 0.4841 0.4891 0.48620.4243 0.3846 Columns 55 through 61 0.3350 0.2755 0.2061 0.1272 0.0392-0.0574 ?(4)z4??t20?t?1?t2 ?1 1?t?2 ,其中t=0:0.5:2.5 ?? t2?2t?12?t?3提示:用逻辑表达式求