MATLAB实训报告
matlab实训报告总结

matlab实训报告总结Matlab实训报告总结摘要:本文总结了在Matlab实训中所学到的知识和经验,包括Matlab的基本操作、常用函数的使用、图形绘制和数据处理等方面。
通过实际操作和实验练习,我们深入了解了Matlab的强大功能和灵活性,在数据处理和科学计算方面取得了令人满意的结果。
1. 引言Matlab是一种强大的科学计算软件,广泛应用于工程、数学、物理和其他科学领域。
在Matlab实训中,我们学习了如何使用Matlab 进行数据处理、模拟实验和图形绘制等操作。
2. 实训内容在实训中,我们首先学习了Matlab的基本操作,包括变量的定义和赋值、数组和矩阵的创建和运算,以及条件语句和循环语句的使用。
这些基本操作是我们后续实验的基础。
接着,我们学习了常用函数的使用。
Matlab提供了许多内置函数,例如求解方程、插值、傅里叶变换等。
我们通过实际例子学习了这些函数的使用方法,并在实验中应用到了实际问题中。
在图形绘制方面,Matlab提供了丰富的绘图函数,可以绘制二维和三维图形。
我们学习了如何绘制线条、曲线、散点图和柱状图等,并通过实验练习提高了我们的图形绘制能力。
我们学习了数据处理的方法。
Matlab提供了强大的数据处理函数,可以对数据进行滤波、拟合、统计和分析等操作。
我们通过实验掌握了这些数据处理方法,并将其应用到了实际数据中。
3. 实训成果通过Matlab实训,我们取得了一些令人满意的成果。
首先,我们掌握了Matlab的基本操作,能够灵活运用各种语句和函数解决问题。
其次,我们学会了使用Matlab进行数据处理和图形绘制,能够对实验数据进行分析和展示。
最后,我们通过实验练习,提高了自己的问题解决能力和创新思维。
4. 实训心得在Matlab实训中,我们遇到了一些困难和挑战。
但是通过不断的尝试和学习,我们克服了这些困难,取得了一些进步。
在实训中,我们学会了如何提高自己的编程技巧和问题解决能力,培养了耐心和坚持的品质。
MATLAB实验报告

MATLAB实验报告一、实验目的本次 MATLAB 实验旨在深入了解和掌握 MATLAB 软件的基本操作和应用,通过实际编程和数据处理,提高解决问题的能力,培养编程思维和逻辑分析能力。
二、实验环境本次实验使用的是 MATLAB R2020a 版本,运行在 Windows 10 操作系统上。
计算机配置为英特尔酷睿 i5 处理器,8GB 内存。
三、实验内容(一)矩阵运算1、矩阵的创建使用直接输入、函数生成和从外部文件导入等方式创建矩阵。
例如,通过`1 2 3; 4 5 6; 7 8 9` 直接输入创建一个 3 行 3 列的矩阵;使用`ones(3,3)`函数创建一个 3 行 3 列元素全为 1 的矩阵。
2、矩阵的基本运算包括矩阵的加减乘除、求逆、转置等。
例如,对于两个相同维度的矩阵`A` 和`B` ,可以进行加法运算`C = A + B` 。
3、矩阵的特征值和特征向量计算通过`eig` 函数计算矩阵的特征值和特征向量,加深对线性代数知识的理解和应用。
(二)函数编写1、自定义函数使用`function` 关键字定义自己的函数,例如编写一个计算两个数之和的函数`function s = add(a,b) s = a + b; end` 。
2、函数的调用在主程序中调用自定义函数,并传递参数进行计算。
3、函数的参数传递了解值传递和引用传递的区别,以及如何根据实际需求选择合适的参数传递方式。
(三)绘图功能1、二维图形绘制使用`plot` 函数绘制简单的折线图、曲线等,如`x = 0:01:2pi; y = sin(x); plot(x,y)`绘制正弦曲线。
2、图形的修饰通过设置坐标轴范围、标题、标签、线条颜色和样式等属性,使图形更加清晰和美观。
3、三维图形绘制尝试使用`mesh` 、`surf` 等函数绘制三维图形,如绘制一个球面`x,y,z = sphere(50); surf(x,y,z)`。
(四)数据处理与分析1、数据的读取和写入使用`load` 和`save` 函数从外部文件读取数据和将数据保存到文件中。
MATLAB实习报告

MATLAB实习报告实习报告一、实习单位概述我在公司完成了为期两个月的MATLAB实习。
该公司是一家致力于研发和生产先进电子产品的科技型企业。
公司专注于电脑硬件和软件产品的开发,拥有一支强大的研发团队,同时与多个国内外知名大学与研究机构合作。
二、实习内容在实习期间,我主要负责开发一个基于MATLAB的图像处理算法,用于自动识别和分类图像中的目标物体。
具体而言,我的任务包括以下几个方面:1.数据预处理:对输入图片进行预处理,包括灰度化、降噪、图像增强等操作,以提高后续算法的准确性和鲁棒性。
2.特征提取:使用MATLAB内置的图像处理工具箱,提取目标物体的特征信息,如颜色、纹理、形状等。
3.目标识别:通过编写MATLAB脚本,实现目标物体的自动识别,使用机器学习算法训练分类器,并应用于测试集中的图像。
4.结果评估:对算法的准确性和性能进行评估,包括计算分类准确率、召回率等指标,并分析算法的优缺点和改进空间。
三、实习收获通过这次实习,我收获了许多宝贵的经验和知识。
首先,我深入学习了MATLAB的图像处理工具箱,了解了常用的图像处理算法和技术。
在实践中,我熟悉了MATLAB的基本语法和函数,并学会了如何利用MATLAB进行图像的读取、处理和保存。
其次,我掌握了图像特征提取和目标识别的方法和技巧。
通过对图像进行灰度化、降噪和图像增强等预处理步骤,我能够有效提取目标物体的特征信息,并通过机器学习算法实现目标的自动识别和分类。
最后,我学会了如何评估和改进算法的准确性和性能。
通过对测试集中的图像进行分类,并计算分类准确率和召回率等指标,我能够客观地评估算法的优劣,并提出针对性的改进方法。
四、实习总结通过这次实习,我不仅得到了理论知识的巩固和实践技能的提升,还培养了团队合作和解决问题的能力。
在与团队成员的合作中,我学会了如何与他人相互协作,分享经验与知识,并且通过互相帮助和配合,达到更好的工作效果。
同时,面对实习过程中遇到的问题和困难,我学会了如何利用各种资源和工具,积极主动地解决问题。
matlab实习总结.(大全5篇)

matlab实习总结.(大全5篇)第一篇:matlab实习总结.MATLAB和Mathematica、Maple并称为三大数学软件。
它在数学类科技应用软件中在数值计算方面首屈一指。
MATLAB可以进行矩阵运算、绘制函数和数据、实现算法、创建用户界面、连 matlab开发工作界面接其他编程语言的程序等,主要应用于工程计算、控制设计、信号处理与通讯、图像处理、信号检测、金融建模设计与分析等领域。
MATLAB的基本数据单位是矩阵,它的指令表达式与数学、工程中常用的形式十分相似,故用MATLAB来解算问题要比用C,FORTRAN等语言完成相同的事情简捷得多,并且MATLAB也吸收了像Maple等软件的优点,使MATLAB成为一个强大的数学软件。
在新的版本中也加入了对C,FORTRAN,C++,JAVA的支持。
可以直接调用,用户也可以将自己编写的实用程序导入到MATLAB函数库中方便自己以后调用,此外许多的MATLAB爱好者都编写了一些经典的程序,用户可以直接进行下载就可以用Matlab是一个强大的数学工具,它的应用广泛,涉及到各个领域.它使用起来十分方便,不用麻烦去定义变量.它的绘图能力很强,甚至可以模拟出三维视图.矩阵是它应用的核心,许多工程繁琐的运算都需要靠矩阵来化简,这正是它的生命力所在.但是,他的函数很多,开始学时记的比较痛苦,我已经深深感觉到了.不过看多了也就熟了,感觉和学五笔差不多.它的语法简单,像我学过C语言的学起来还是蛮容易的.它的数组定义十分符合自然,是从1开始的,数组元素的调用也很接近数学的表达.此外,函数的名字也很符合英文规则,反正我用得很开心就是了.通过学习matlab,我又一次锻炼了自己的思维.它学起来得心应手也让我明白了学习一门语言(c语言对学习其他语言的帮助指导作用.同时,它也加强了我理论联系实际的能力.这是一个专业课的基础工具,学好它是必要的.在第一章中,讲的是一些matlab的入门技术,除了一些基本操作与介绍之外,还初步认识了简单指令的编制,认识了一些matlab 的特殊符号,例如运算用到的加减乘除。
matlab实验报告

(2)将上述信号左平移或右平移 得到两个新信号y2和y3,利用hold命令在同一图中显示三条曲线并通过线型和颜色加以区分。
(3)利用subplot命令将y,y2和y3以子图的形式显示。
3.
实验结果及分析
1.(1)
t1 =
0.0780
实验结果及分析
(2)
t2 =
0.0780
实验结果及分析
(3)
t3 =
0
实验结果及分析
2.
实验
名称
实验四Matlab在通信系统中的应用
实验目的
1、练习通信原理中各种调制方法及简单通信系统的Matlab编程实现;
2、学习Matlab与Simulink的混合编程。
(2)y变成虚数后,重复上述运算。
(3)创建矩阵 ,并进行如下操作,取出矩阵A的前两行元素,生成一个新矩阵B。生成一个3*3的单位矩阵B,与矩阵A进行加、减、乘、除、相等、不相等运算。
(4)随机生成2个复数x1和x2,计算x3=x1÷x2,x3的实部real_x3、虚部image_x3、模abs_x3、幅角angle_x3,并把x1,x2,x3,real_x3,image_x3,abs_x3,angle_x3保存至文件complex_学号.mat。利用save命令保存数据为mat格式文件后,用clear命令清除工作空间中的变量,再利用load命令从文件读入数据。
2、流程控制语句相关操作。
(1)使用for语句及while语句求解1至100整数中奇数的和。
(2)求连续自然数的和,当和大于等于1000时,求最后一个自然数以及自然数的和。
MATLAB_实习报告范文大全

MATLAB_实习报告范文大全第一篇:MATLAB_实习报告实习报告实习题目:专业:学号:的设计与绘图MATLAB 一.概述MATLAB 作为一种高级科学计算软件,是进行算法开发、数据可视化、数据分析以及数值计算的交互式应用开发环境。
世界上许许多多的科研工作者都在使用 MATLAB 产品来加快他们的科研进程,缩短数据分析和算法开发的时间,研发出更加先进的产品和技术。
二.实验目的1.进一步熟悉MATLAB的软件环境和基本使用方法;2.巩固运用MATLAB、矩阵运算、多项式运算、字符串、单元数组、符号计算功能、绘图及句柄图形及它们的命令语句;3.学习和巩固数字图形图像处理在MATLAB中的知识和运用;4.培养我们独立自学、设计和撰写实验报告的能力;5.通过对MATLAB的进一步学习,是我们加深所学内容的认识,理解,掌握,能把所学知识运用到实际工作中;三.实习日记1.熟悉MATLAB的软件环境和基本使用方法(第一周)MATLAB的语言的基本功能和特点:它是一种高级科学计算语言,相对于传统的C、C++ 或者FORTRAN 语言,MATLAB 提供了高效快速解决各种科学计算问题的方法。
它具有数学计算、开发工具、数据的可视化、交互式编辑创建图形、集成的算法开发编程语言和环境、图形用户界面开发环境——GUIDE、开放性、可扩展性强、专业应用工具箱等强大的功能。
具有易于学习、使用方便、支持多种操作系统、丰富的内部函数、强大的图形和符号功能等优点。
路径设置:除 MATLAB 默认的搜索路径外,用户可以设置搜索路径。
设置方法为:选择 MATLAB 窗口中的 File | Set Path 命令,进入路径搜索对话框。
MATLAB 的搜索顺序:当在命令窗口中或者一个 M 文件中输入一个元素名时,MATLAB 按照下面的顺序搜索该元素的意义,以元素foo 为例:1)查找工作区中是否存在名为 foo 的变量; 2)在当前路径中查找是否存在名 foo.m 的文件;3)按照顺序查找搜索路径中是否存在该文件。
MATLAB实验报告(8个实验)

四川师范大学MATLAB语言实验报告1系级班年月日实验名称:Intro, Expressions, Commands姓名学号指导教师成绩1ObjectiveThe objective of this lab is to familiarize you with the MATLAB program development environment and to develop your first programs in this environment.2Using MATLAB2.1Starting MATLABLogon to your computer and start MATLAB by double-clicking on the icon on the desktop or by using the Start Programs menu. MATLAB Desktop window will appear on the screen.The desktop consists of several sub-windows. The most important ones are:●Command Window (on the right side of the Desktop) is used to do calculations,enter variables and run built-in and your own functions.●Workspace (on the upper left side) consists of the set of variables (arrays) createdduring the current MATLAB session and stored in memory.●Command History (on the lower left side) logs commands entered in theCommand Window. You can use this window to view previously run statements, and copy and execute selected statements.You can switch between the Launch Pad window and the Workspace window using the menu tabs under the sub-window on the upper left side. Similarly, you can switch between the Command History and Current Directory windows using the menu tabs under the sub-window on the lower left side.2.2Executing CommandsYou can type MATLAB commands at the command prompt “>>” on the Command Window.For example, you can type the formula cos(π/6)2sin(3π/8) as>>(cos(pi/6) ^ 2) * (sin(3 * pi/8))Try this command. After you finish typing, press enter. The command will be interpreted and the result will be displayed on the Command Window.Try the following by observing how the Workspace window changes:>> a = 2; (M ake note of the usage of “;”)>> b = 3;>> c = a ^ 4 ∗ b ∗ 5 + pi ^3You can see the variables a, b and c with their types and sizes on the Workspacewindow, and can see the commands on the Command History window.Spend a few minutes to practice defining array variables (i.e. vectors and matrices)usingthe square bracket (“[ ]”) and colon (“:”) operators, and zeros() and ones() functions.>> ar =[ 1 2 3 4 5 ];>> br =[ 1 2 3 ;4 5 6 ];>> cr = [1 : 3 : 15];• Set dr to first 3 elements of ar.dr=ar(1:3);• Set er to second row of br.er=br(2,:);• Set ar to [dr er]. Find the number of elements of ar.ar=[dr er]; length(ar)2.3 Getting HelpThere are several ways to get help on commands and functions in MATLAB. First ofall you can use the Help menu. You can also use the “?” button. Try to findinformation on the plot function from the help index. Also try to get information onthe same function using the help command (i.e. type help plot). Finally, experimentwith the lookfor command. This command looks for other commands related to agiven keyword.2.4 Some Useful CommandsTry the following commands and observe their results:Which : Version and location infoClear : Clears the workspaceClc : Clears the command windowwho, whos : Lists content of the workspace3 ExercisesPlease solve the following problems in MATLAB. Do not forget to keep a diary ofyour commands and their outputs.(1) Define the variables x y and z as 7.6, 5.5 and 8.1, respective ly, and evaluate:578.422.52⎪⎭⎫ ⎝⎛-x y xz(2) Compute the slope of the line that passes through the points (1,-2) and(5,8).(3) Quiz 1.1: 5(4)1.6 Exercises: 1.1, 1.4(5)2.15 Exercises: 2.6, 2.9, 2.114Quitting MATLABTyping quit on the command window will close the program. Do not forget to send your diary file and M-file to your TA.Do not forget to delete your files from the hard disk of the PC you used in the lab at the end of the lab session.四川师范大学MATLAB语言实验报告2系级班年月日实验名称:Programming, Relational and Logical Expressions姓名学号指导教师成绩1ObjectiveThe objective of this lab is to familiarize you with the MATLAB script files (M-files), subarrays, relational and logical operators.2Script FilesScript files are collections of MATLAB statements that are stored in a file. Instead of typing commands directly in the Command Window, a series of commands may be placed into a file and the entire file may be executed by typing its name in the Command Window. Such files are called script files that are also known as M-files because they have an extension of .m. When a script file is executed, the result is the same as it would be if all of the commands had been typed directly into the Command Window. All commands and script files executed in the Command Window share a common workspace, so they can all share variables in the workspace. Note that if two script files are executed successively, the second script file can use the variables created by the first script file. In this way, script files can communicate with other script files through the data left behind in the workspace. An Edit Window is used to create new M-files or to modify existing ones. The Edit Window is a programming text editor, with the features of MATLAB language highlighted in different colors. You can create a new M-file with the File/New/M-file selection and you can open an existing M-file with the File/Open selection from the desktop menu of MATLAB. (1)Create a new working directory under the current directory and change the currentdirectory to ‘TA’s suggest’.3SubarraysIt is possible to select and use subsets of MATLAB arrays. To select a subset of an array, just include a list of the elements to be selected in the parentheses after the array name. MATLAB has a special function named end that is used to create arraysubscripts. The end function always returns the highest value taken on by a givensubscript. It is also possible to use subarrays on the left-hand side of an assignmentstatement to change only some of the values in an array. If values are assigned to asubarray, only those values are changed but if values are assigned to an array, theentire contents of the array are replaced by the new values.(1) Define the following 5 x 5 array arr1 in MATLAB.⎥⎥⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎢⎢⎣⎡----=2274235421209518171651413215111012844563311arr(2) Write a MATLAB statement to select a subset of arr1 and return the subarraycontaining the values as shown.⎥⎦⎤⎢⎣⎡=22745456311arrarr11=arr1([1,5],[2 4 5]);(3) Write two MATLAB statements to select the last row and last column of arr1,separately.arr12=arr1(5,:);或arr12=arr1(end,:); arr13=arr1(:,end);或 arr13=arr1(:,5);(4) Write MATLAB statements to obtain the following array from arr1.⎥⎥⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎢⎢⎣⎡-=2257462335432112arrarr2=arr1([1 5],:)';4 Relational and Logical OperatorsRelational and logical operators are the two types of operators that produce true/falseresults in MATLAB programs. MATLAB interprets a zero value as false and anynonzero value as true. Relational operators ( ==, =,>,>=,<,<=) are operators with twooperands that produce either a true (1) or a false (0) result, depending on the values ofthe operands. Relational operators can be used to compare a scalar value with an array.They can also be used to compare two arrays or two strings only if they have the samesize. Be careful not to confuse the equivalence relational operator ( == ) with theassignment operator ( = ). Logic operators ( &, |, xor, ~ ) are operators with one ortwo operands that yield a logical result such as 0 or 1. There are three binary logicoperators: AND (& ), OR ( |), and exclusive OR ( xor ); and one unary operator: NOT( ~ ). In the hierarchy of operations, logic operators are evaluated after allarithmetic and relational operators have been evaluated. The operator is evaluatedbefore other logic operators.(1) Define the following 4 x 5 array arr4 in MATLAB.⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎣⎡------=212343212343212543214arr(2) Write an expression using arr4 and a relational operator to produce the followingresult.⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎣⎡=110001110011110111115arrarr5=arr4>0;(3) Write an expression using arr4 and a relational operator to produce the followingresult.⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎣⎡=010000010000010000016arrarr6=arr4==1;(4) Write a MATLAB program which will generate an (n-1)x(n-1) matrix from agiven nxn matrix which will be equal to given matrix with first row and firstcolumn deleted.arr44=rand(5); arr444=arr35(2:end,2:end);(5) Generalize your program above so that the program should ask the row andcolumn numbers to be deleted and then generate new (n-1)x(n-1) matrix.n=input('input n:');matrixn=rand(n)delrow=input('input row numbers to be deleted:');delcolumn=input('input column numbers to be deleted:');matrixn_1=matrixn([1:delrow-1 delrow+1:end], [1:delcolumn-1 delcolumn+1:end])(6) Quiz 3.1 (P88)5 Quitting MATLABTyping quit on the command window will close the program. Do not forget to sendyour diary file and M-file to your TA.Do not forget to delete your files from the hard disk of the PC you used in the lab atthe end of the lab session.四川师范大学MATLAB 语言实验报告3系 级 班 年 月 日实验名称:Branches and Loops, Logical Arrays.姓名 学号 指导教师 成绩 1 ObjectiveThe objective of this lab is to familiarize you with the MATLAB Branches and Loops,Logical Arrays.2 ExercisesDo not forget to add sufficient documentation and proper indentation to all programsyou write.(1) Write a program that calculates follow equation with for and while loop, and writea program without loop.63263022212+++==∑=Λi i K% for loopk1=0;for ii=1:64k1=k1+2^(ii-1);end% while loopk2=0;n=0;while n>=0&n<64k2=k2+2^n;n=n+1;end% without loopa=0:63;b=2.^a;K3=sum(b);(2) Write a program that accepts a vector of integers as input and counts the numberof integers that are multiples of 3 in that vector. You can assume that the inputcontains only integer values. An example run of your program can be as follows:Enter a vector of integers: [ 1 3 2 8 0 5 6 ]The number of multiples of 3 is 2(3) The root mean square is a way for calculating a mean for a set of numbers. The rmsaverage of a series of numbers is given as:∑==N i i x N rmsaverage 121Write a program that will accept an arbitrary number of input values and calculatethe rmsaverage of the numbers. The program should ask the user for the numberof values to be entered. Test your program with 4 and 10 set of numbers.% The root mean square is a way for calculating a mean for a set of numbers% Initializesum_x2=0;% Get the number of points to input.n=input('Enter number of points:');% Loop to read input valuesfor ii=1:n% Read in next valuex=input('Enter value:');% Calculate square sumssum_x2=sum_x2+x^2;end% Now calculate root mean squareroot_ms=sqrt(sum_x2/n);% Tell userfprintf('The number of data points is: %d\n',n);fprintf('The root mean square of this data set is: %f\n',root_ms);(4) 3.8 exercises:3.5(5) 4.7Exercises: 4.1 4.23 Quitting MATLABTyping quit on the command window will close the program. Do not forget to sendyour M-file to your TA.Do not forget to delete your files from the hard disk of the PC you used in the lab at the end of the lab session.四川师范大学MATLAB语言实验报告4系级班年月日实验名称:MATLAB/SIMULINK package姓名学号指导教师成绩1Objective●To learn how to use MATLAB/SIMULINK package●To learn how to estimate performance parameters from time-domain data2SIMULINK BasicBasic steps(1)Click on the MATLAB button to start MATLAB.(2)Once MATLAB has started up, type simulink (SMALL LETTERS!) at theMATLAB prompt (>>) followed by a carriage return (press the return key). A SIMULINK window should appear shortly, with the following icons: Sources, Sinks, Discrete, Linear, Connections, Extras.(3)Next, go to the File menu in SIMULINK window and choose New in order tobegin building the block diagram representation of the system of interest.(4)Open one or more of the block libraries and drag the chosen blocks into the active.(5)After the blocks are placed, draw lines to connect their input and output ports bymoving the mouse over a port and drag using the left button. To make a line witha right angle in it, release the button where you want the corner, then click on theend of the line and drag to create next segment. To add a second line that runs off of an existing line click the right mouse on an existing line and drag it.(6)Save the system by selecting Save from the File menu.(7)Open the blocks by double-clicking and change some of their internal parameters.(8)Adjust some simulation parameters by selecting Parameters from the Simulationmenu. The most common parameter to change is Stop Time that defines the length of time the simulation will run.(9)Run the simulation by selecting Start from the Simulation menu. You can stop asimulation before completing by selecting Stop from the Simulation menu. (10)View the behavior of the system by attaching Scope blocks to the variables ofinterest, or by using To Workspace blocks to send data to the MATLAB workspace where you can plot the results using standard MATLAB commands.3Exercises(1)Your TA has shown you how to observe and print signals from the scope. Try thisout by printing out the input signal, which should be a -1V to 1V square wave with frequency 0.1 Hz. Note the peak-to-peak voltage difference of this signal.Note to write key blocks parameters.(2) Write a Simulink model to calculate the following differential equation,0)1(222=+--x dt dx x dt x d μInitialized 1)0(=x ,0)0(=dt dx 。
MATLAB实训报告_2

M AT L A B语言编程实训报告题目MATLAB在信号与系统中的应用年级2008 专业电子信息工程目录第一章绪论 (2)1.1 本设计课题目的及意义, 重点解决的问题 (2)1.1.1 MATLAB在信号与系统中应用的目的及意义 (2)1.1.2 重点解决的问题 (2)1.2 课题的社会和技术背景 (2)1.3 实现的具体功能 (3)第二章课题的基本概念和原理 (4)2.1 MATLAB的概念 (4)2.2 信号与系统的概念 (4)2.3 信号与系统分析的基本内容与方法 (5)2.4 离散系统的基本概念 (6)2.5连续系统模型及表示 (6)第三章系统设计和实现 (7)3.1采用的软件及开发平台 (7)3.1.1系统设计软件 (7)3.1.2开发平台和编程环境 (7)3.2系统的详细设计 (8)3.2.1建模 (8)3.2.2解决方法 (9)3.3系统设计的亮点 (9)第四章结束语 (10)参考文献 (10)第一章绪论1.1 本设计课题目的及意义, 重点解决的问题1.1.1 MATLAB在信号与系统中应用的目的及意义MATLAB在信号与系统中应用能够让学生熟悉MATLAB软件平台、工具箱、高效的数值计算及符号计算功能。
熟悉MATLAB软件的信号处理编程方法和结果的可视化。
了解数字信号处理的计算机仿真方法。
进一步加深对信号与系统的基本原理、方法及应用的理解。
MATLAB软件具有强大的数值分析和计算结果可视化的功能.运用MATLAB软件,通过一个应用实例,将信号与系统课程的理论与实践教学有机地结合,有效地解决了教学中的难点问题,说明了MATLAB软件在信号与系统课程的实践教学中具有重要的实际意义1.1.2 重点解决的问题matlab的基本使用方法, matlab的预定义函数, 如何用matlab绘图, 如何在matlab中编程, 基于matlab的矩阵运算、符号运算、数值分析等。
1.2 课题的社会和技术背景长期以来, “信号与系统”课程一直采用黑板式的单一的教学方式, 学生仅依靠做习题来巩固和理解教学内容, 对课程中大量的应用性较强的内容不能实际动手设计、调试、分析, 严重影响和制约了教学效果。
multlab实验报告

实验一MATLAB操作基础实验目的和要求:1、熟悉MATLAB的操作环境及基本操作方法。
2、掌握MATLAB的搜索路径及设置方法。
3、熟悉MATLAB帮助信息的查阅方法实验内容:1、建立自己的工作目录,再设置自己的工作目录设置到MA TLAB搜索路径下。
>> cd c:\matlab1>> path(path,'c:\matlab1')2、在MA TLAB的操作环境下验证课本例1-4,总结MATLAB的特点。
>> a=[2,-3,1;8,3,2;45,1,-9];>> b=[4;2;17];>> x=inv(a)*b3、利用帮助功能查询inv、plot、max、round等函数的功能。
>> help inv>> help plot>> help max>> help round4. >> x=0:pi/10:2*pi;>> y=sin(x);图形含义:图形为区间[0,2π]内的正弦函数,5.实验二MATLAB矩阵及运算实验目的和要求:1、掌握MATLAB数据对象的特点及运算规则2、掌握MATLAB建立矩阵的方法及矩阵处理的方法3、掌握MATLAB分析的方法实验内容:1.(1)>> w=sqrt(2)*(1+0.34245e-6)(2)>> a=3.5;b=5;c=-9.8;x=(2*pi*a+(b+c)/(pi+a*b*c)-exp(2))/(tan(b+c)+a)(3)>> a=3.32;b=-7.9;>> y=2*pi*a*a*((1-pi/4)*b-(0.8333-pi/4)*a)(4)>> t=[2,1-3i;5,-0.65];z=1/2*exp(2*t)*log10(t+sqrt(1+t*t))2.(1)> a=[-1,5,-4;0,7,8;3,61,7];>> b=[8,3,-1;2,5,3;-3,2,0];>> a+6*b>>a*a-b+eye(3)(2) >> a*b>> a.*b>> b*a (3) >> a/b>> b/a (4) >> [a,b]>> [a([1,3],:);b^2]3.(1)>> a=[23,10,-0.778,0;41,-45,65,5;32,5,0,32;6,-9.54,54,3.14];>> k=find(a>10 & a<25);>> a(k)(2)>> a=[23,10,-0.778,0;41,-45,65,5;32,5,0,32;6,-9.54,54,3.14]; >> b=a(1:3,:);c=a(:,1:2);d=a(2:end,3:end);e=b*c;(3)>> a=[23,10,-0.778,0;41,-45,65,5;32,5,0,32;6,-9.54,54,3.14]; >> b=a(1:3,:);c=a(:,1:2);d=a(2:end,3:end);e=b*c;>> e<d>> e&d>> e|d>> ~e|~d实验三MATLAB程序设计实验目的和要求:1、掌握利用if语句、switch语句实现选择结构的方法。
MATLAB实验报告(8个实验)

MATLAB实验报告(8个实验)四川师范⼤学MATLAB语⾔实验报告1系级班年⽉⽇实验名称:Intro, Expressions, Commands姓名学号指导教师成绩1ObjectiveThe objective of this lab is to familiarize you with the MATLAB program development environment and to develop your first programs in this environment.2Using MATLAB2.1Starting MATLABLogon to your computer and start MATLAB by double-clicking on the icon on the desktop or by using the Start Programs menu. MATLAB Desktop window will appear on the screen.The desktop consists of several sub-windows. The most important ones are:●Command Window (on the right side of the Desktop) is used to do calculations,enter variables and run built-in and your own functions.●Workspace (on the upper left side) consists of the set of variables (arrays) createdduring the current MATLAB session and stored in memory.●Command History (on the lower left side) logs commands entered in theCommand Window. You can use this window to view previously run statements, and copy and execute selected statements.You can switch between the Launch Pad window and the Workspace window using the menu tabs under the sub-window on the upper left side. Similarly, you can switch between the Command History and Current Directory windows using the menu tabs under the sub-window on the lower left side.2.2Executing CommandsYou can type MATLAB commands at the command prompt “>>” on the Command Window.For example, you can type the formula cos(π/6)2sin(3π/8) as>>(cos(pi/6) ^ 2) * (sin(3 * pi/8))Try this command. After you finish typing, press enter. The command will be interpreted and the result will be displayed on the Command Window.Try the following by observing how the Workspace window changes:>> a = 2; (M ake note of the usage of “;”)>> b = 3;>> c = a ^ 4 ? b ? 5 + pi ^3You can see the variables a, b and c with their types and sizes on the Workspacewindow, and can see the commands on the Command History window.Spend a few minutes to practice defining array variables (i.e. vectors and matrices)usingthe square bracket (“[ ]”) and colon (“:”) operators, and zeros() and ones() functions.>> ar =[ 1 2 3 4 5 ];>> br =[ 1 2 3 ;4 5 6 ];>> cr = [1 : 3 : 15];Set dr to rst 3 elements of ar.dr=ar(1:3);Set er to second row of br.er=br(2,:);Set ar to [dr er]. Find the number of elements of ar.ar=[dr er]; length(ar)2.3 Getting HelpThere are several ways to get help on commands and functions in MATLAB. First ofall you can use the Help menu. You can also use the “?” button. Try to findinformation on the plot function from the help index. Also try to get information onthe same function using the help command (i.e. type help plot). Finally, experimentwith the lookfor command. This command looks for other commands related to agiven keyword.2.4 Some Useful CommandsTry the following commands and observe their results:Which : Version and location infoClear : Clears the workspaceClc : Clears the command windowwho, whos : Lists content of the workspace3 ExercisesPlease solve the following problems in MATLAB. Do not forget to keep a diary ofyour commands and their outputs.(1) De?ne the variables x y and z as 7.6, 5.5 and 8.1, respective ly, and evaluate:578.422.52??? ??-x y xz(2) Compute the slope of the line that passes through the points (1,-2) and(5,8).(3) Quiz 1.1: 5(4)1.6 Exercises: 1.1, 1.4(5)2.15 Exercises: 2.6, 2.9, 2.114Quitting MATLABTyping quit on the command window will close the program. Do not forget to send your diary file and M-file to your TA. Do not forget to delete your ?les from the hard disk of the PC you used in the lab at the end of the lab session.四川师范⼤学MATLAB语⾔实验报告2系级班年⽉⽇实验名称:Programming, Relational and Logical Expressions姓名学号指导教师成绩1ObjectiveThe objective of this lab is to familiarize you with the MATLAB script files (M-files), subarrays, relational and logical operators.2Script FilesScript files are collections of MATLAB statements that are stored in a file. Instead of typing commands directly in the Command Window, a series of commands may be placed into a file and the entire file may be executed by typing its name in the Command Window. Such files are called script files that are also known as M-files because they have an extension of .m. When a script file is executed, the result is the same as it would be if all of the commands had been typed directly into the Command Window. All commands and script files executed in the Command Window share a common workspace, so they can all share variables in the workspace. Note that if two script files are executed successively, the second script file can use the variables created by the first script file. In this way, script files can communicate with other script files through the data left behind in the workspace. An Edit Window is used to create new M-files or to modify existing ones. The Edit Window is a programming text editor, with the features of MATLAB language highlighted in different colors. You can create a new M-file with the File/New/M-file selection and you can open an existing M-file with the File/Open selection from the desktop menu of MATLAB. (1)Create a new working directory under the current directory and change the currentdirectory to …TA?s suggest?.3SubarraysIt is possible to select and use subsets of MATLAB arrays. To select a subset of an array, just include a list of the elements to be selected in the parentheses after the array name. MATLAB has a special function named end that is used to create array subscripts. The end function always returns the highest value taken on by a givensubscript. It is also possible to use subarrays on the left-hand side of an assignmentstatement to change only some of the values in an array. If values are assigned to asubarray, only those values are changed but if values are assigned to an array, theentire contents of the array are replaced by the new values.(1) Define the following 5 x 5 array arr1 in MATLAB.----=2274235421209518171651413215111012844563311arr(2) Write a MATLAB statement to select a subset of arr1 and return the subarraycontaining the values as shown.=22745456311arrarr11=arr1([1,5],[2 4 5]);(3) Write two MATLAB statements to select the last row and last column of arr1,separately.arr12=arr1(5,:);或arr12=arr1(end,:); arr13=arr1(:,end);或 arr13=arr1(:,5);(4) Write MATLAB statements to obtain the following array from arr1.-=2257462335432112arrarr2=arr1([1 5],:)';4 Relational and Logical OperatorsRelational and logical operators are the two types of operators that produce true/falseresults in MATLAB programs. MATLAB interprets a zero value as false and any nonzero value as true. Relational operators ( ==, =,>,>=,<,<=) are operators with two operands that produce either a true (1) or a false (0) result, depending on the values of the operands. Relational operators can be used to compare a scalar value with an array. They can also be used to compare two arrays or two strings only if they have the same size. Be careful not to confuse the equivalence relational operator ( == ) with the assignment operator ( = ). Logic operators ( &, |, xor, ~ ) are operators with one ortwo operands that yield a logical result such as 0 or 1. There are three binary logic operators: AND (& ), OR ( |), and exclusive OR ( xor ); and one unary operator: NOT ( ~ ). In the hierarchy of operations, logic operators are evaluated after allarithmetic and relational operators have been evaluated. The operator is evaluated before other logic operators.(1) Define the following 4 x 5 array arr4 in MATLAB.------=212343212343212543214arr(2) Write an expression using arr4 and a relational operator to produce the following result.=110001110011110111115arrarr5=arr4>0;(3) Write an expression using arr4 and a relational operator to produce the following result.=010000010000010000016arrarr6=arr4==1;(4) Write a MATLAB program which will generate an (n-1)x(n-1) matrix from agiven nxn matrix which will be equal to given matrix with first row and firstcolumn deleted.arr44=rand(5); arr444=arr35(2:end,2:end);(5) Generalize your program above so that the program should ask the row and column numbers to be deleted and then generate new (n-1)x(n-1) matrix.n=input('input n:');matrixn=rand(n)delrow=input('input row numbers to be deleted:');delcolumn=input('input column numbers to be deleted:');matrixn_1=matrixn([1:delrow-1 delrow+1:end], [1:delcolumn-1 delcolumn+1:end]) (6) Quiz 3.1 (P88)5 Quitting MATLABTyping quit on the command window will close the program. Do not forget to send your diary file and M-file to your TA.Do not forget to delete your files from the hard disk of the PC you used in the lab at the end of the lab session.四川师范⼤学MATLAB 语⾔实验报告3系级班年⽉⽇实验名称:Branches and Loops, Logical Arrays.姓名学号指导教师成绩 1 ObjectiveThe objective of this lab is to familiarize you with the MATLAB Branches and Loops, Logical Arrays.2 ExercisesDo not forget to add sufficient documentation and proper indentation to all programs you write.(1) Write a program that calculates follow equation with for and while loop, and writea program without loop.63263022212+++==∑= i i K% for loopk1=0;for ii=1:64k1=k1+2^(ii-1);end% while loopk2=0;n=0;while n>=0&n<64k2=k2+2^n;n=n+1;end% without loopa=0:63;b=2.^a;K3=sum(b);(2) Write a program that accepts a vector of integers as input and counts the numberof integers that are multiples of 3 in that vector. You can assume that the inputcontains only integer values. An example run of your program can be as follows:Enter a vector of integers: [ 1 3 2 8 0 5 6 ]The number of multiples of 3 is 2(3) The root mean square is a way for calculating a mean for a set of numbers. The rmsaverage of a series of numbers is given as:∑==N i i xN rmsaverage 121Write a program that will accept an arbitrary number of input values and calculatethe rmsaverage of the numbers. The program should ask the user for the numberof values to be entered. Test your program with 4 and 10 set of numbers.% The root mean square is a way for calculating a mean for a set of numbers% Initializesum_x2=0;% Get the number of points to input.n=input('Enter number of points:');% Loop to read input valuesfor ii=1:n% Read in next valuex=input('Enter value:');% Calculate square sumssum_x2=sum_x2+x^2;end% Now calculate root mean squareroot_ms=sqrt(sum_x2/n);% Tell userfprintf('The number of data points is: %d\n',n);fprintf('The root mean square of this data set is: %f\n',root_ms);(4) 3.8 exercises:3.5(5) 4.7Exercises: 4.1 4.23 Quitting MATLABTyping quit on the command window will close the program. Do not forget to sendyour M-file to your TA.Do not forget to delete your files from the hard disk of the PC you used in the lab at the end of the lab session.四川师范⼤学MATLAB语⾔实验报告4系级班年⽉⽇实验名称:MATLAB/SIMULINK package姓名学号指导教师成绩1Objective●To learn how to use MATLAB/SIMULINK package●To learn how to estimate performance parameters from time-domain data2SIMULINK BasicBasic steps(1)Click on the MATLAB button to start MATLAB.(2)Once MATLAB has started up, type simulink (SMALL LETTERS!) at theMATLAB prompt (>>) followed by a carriage return (press the return key). A SIMULINK window should appear shortly, with the following icons: Sources, Sinks, Discrete, Linear, Connections, Extras.(3)Next, go to the File menu in SIMULINK window and choose New in order tobegin building the block diagram representation of the system of interest.(4)Open one or more of the block libraries and drag the chosen blocks into the active.(5)After the blocks are placed, draw lines to connect their input and output ports bymoving the mouse over a port and drag using the left button. To make a line witha right angle in it, release the button where you want the corner, then click on theend of the line and drag to create next segment. To add a second line that runs off of an existing line click the right mouse on an existing line and drag it.(6)Save the system by selecting Save from the File menu.(7)Open the blocks by double-clicking and change some of their internal parameters.(8)Adjust some simulation parameters by selecting Parameters from the Simulationmenu. The most common parameter to change is Stop Time that defines the length of time the simulation will run.(9)Run the simulation by selecting Start from the Simulation menu. You can stop asimulation before completing by selecting Stop from the Simulation menu. (10)View the behavior of the system by attaching Scope blocks to the variables ofinterest, or by using To Workspace blocks to send data to the MATLAB workspace where you can plot the results using standard MATLAB commands.3Exercises(1)Your TA has shown you how to observe and print signals from the scope. Try thisout by printing out the input signal, which should be a -1V to 1V square wave with frequency 0.1 Hz. Note the peak-to-peak voltage difference of this signal.Note to write key blocks parameters.(2) Write a Simulink model to calculate the following differential equation,0)1(222=+--x dt dx x dt x d µInitialized 1)0(=x ,0)0(=dt dx 。
(完整word)Matlab实验报告

实验一:Matlab操作环境熟悉一、实验目的1.初步了解Matlab操作环境.2.学习使用图形函数计算器命令funtool及其环境。
二、实验内容熟悉Matlab操作环境,认识命令窗口、内存工作区窗口、历史命令窗口;学会使用format 命令调整命令窗口的数据显示格式;学会使用变量和矩阵的输入,并进行简单的计算;学会使用who和whos命令查看内存变量信息;学会使用图形函数计算器funtool,并进行下列计算:1.单函数运算操作。
求下列函数的符号导数(1)y=sin(x);(2) y=(1+x)^3*(2-x);求下列函数的符号积分(1)y=cos(x);(2)y=1/(1+x^2);(3)y=1/sqrt(1—x^2);(4)y=(x1)/(x+1)/(x+2)求反函数(1)y=(x-1)/(2*x+3); (2) y=exp(x);(3) y=log(x+sqrt(1+x^2));代数式的化简(1)(x+1)*(x-1)*(x-2)/(x-3)/(x—4);(2)sin(x)^2+cos(x)^2;(3)x+sin(x)+2*x—3*cos(x)+4*x*sin(x);2.函数与参数的运算操作。
从y=x^2通过参数的选择去观察下列函数的图形变化(1)y1=(x+1)^2(2)y2=(x+2)^2(3) y3=2*x^2 (4) y4=x^2+2 (5) y5=x^4 (6) y6=x^2/2 3.两个函数之间的操作求和(1)sin(x)+cos(x) (2) 1+x+x^2+x^3+x^4+x^5乘积(1)exp(—x)*sin(x) (2) sin(x)*x商(1)sin(x)/cos(x); (2) x/(1+x^2); (3) 1/(x—1)/(x—2); 求复合函数(1)y=exp(u) u=sin(x) (2) y=sqrt(u) u=1+exp(x^2)(3) y=sin(u) u=asin(x) (4) y=sinh(u) u=-x实验二:MATLAB基本操作与用法一、实验目的1.掌握用MATLAB命令窗口进行简单数学运算。
matlab实习报告二5篇

matlab实习报告二5篇第一篇:matlab实习报告二MATLAB实习报告(2)实验二 MATLAB矩阵分析与处理王夏一、实验目的1、掌握生成特殊矩阵的方法。
2、掌握矩阵分析的方法。
3、用矩阵求逆发解线性方程组。
二、实验内容1、设有分块矩阵A=[E3×3 R3×2;O2×3 S2×2],其中E、R、O、S分别为单位矩阵、随机矩阵、零矩阵和对角阵,试通过数值计算验证A²=[E R+RS;O S²]。
程序清单:E=eye(3);R=rand(3,2);O=zeros(2,3);S=diag([4,5]);A=[E R;O S] ;A2=A^2;C=[E R+R*S;O S^2];length(find(A2==C))==25 运行结果:ans =12、产生5阶希尔伯特矩阵H和5阶帕斯卡矩阵P,且求其行列式的值Hh和Hp以及他们的条件数Th和Tp,判断哪个矩阵的性能更好,为什么?程序清单:format rat H=hilb(5);format short P=pascal(5);Hh=det(H);Hp=det(P);Th=cond(A);Tp=cond(P);运行结果:Hh =3.7493e-012 Hp =1 Th =5.5228 Tp =8.5175e+003 实验收获:会建立希尔伯特矩阵和帕斯卡矩阵,知道怎么求矩阵行列式的值以及条件数。
希尔伯特矩阵的性能更好,条件数越接近1的矩阵性能越好。
3、建立一个5×5矩阵,求它的行列式值、迹、秩和范数。
程序清单:A=[1:5;1:0.1:1.5;2 5 7 3 9;2:6;3:0.4:4.6]Ha=det(A);Ra=rank(A);Ta=trace(A);Na=norm(A);运行结果:Ha =1.4421e-031 Ra = 3 Ta =18.7000 Na =19.49664、已知向量A,求A的特征值及特征向量,并分析其数学意义。
matlab 实验报告

matlab 实验报告Matlab实验报告引言:Matlab是一种强大的数值计算和可视化软件,广泛应用于科学、工程和经济等领域。
本实验报告将介绍我在使用Matlab进行实验过程中的一些经验和结果。
实验一:矩阵运算在这个实验中,我使用Matlab进行了矩阵运算。
首先,我创建了一个3x3的矩阵A和一个3x1的矩阵B,并进行了矩阵相乘运算。
通过Matlab的矩阵乘法运算符*,我得到了一个3x1的结果矩阵C。
接着,我对矩阵C进行了转置操作,得到了一个1x3的矩阵D。
最后,我计算了矩阵C和矩阵D的点积,并将结果输出。
实验二:数据可视化在这个实验中,我使用Matlab进行了数据可视化。
我选择了一组实验数据,包括时间和温度两个变量。
首先,我将数据存储在一个矩阵中,并使用Matlab的plot函数将时间和温度之间的关系绘制成曲线图。
接着,我使用Matlab的xlabel、ylabel和title函数添加了横轴、纵轴和标题。
最后,我使用Matlab的legend函数添加了图例,以便更好地理解图表。
实验三:数值积分在这个实验中,我使用Matlab进行了数值积分。
我选择了一个函数f(x)进行积分计算。
首先,我使用Matlab的syms函数定义了符号变量x,并定义了函数f(x)。
接着,我使用Matlab的int函数对函数f(x)进行积分计算,并将结果输出。
为了验证结果的准确性,我还使用了Matlab的diff函数对积分结果进行了求导操作,并与原函数f(x)进行了比较。
实验四:信号处理在这个实验中,我使用Matlab进行了信号处理。
我选择了一个音频文件,并使用Matlab的audioread函数读取了该文件。
接着,我使用Matlab的fft函数对音频信号进行了傅里叶变换,并将结果绘制成频谱图。
为了进一步分析信号的特征,我还使用了Matlab的spectrogram函数绘制了信号的时频图。
通过对信号的频谱和时频图的观察,我可以更好地理解信号的频率和时域特性。
MATLAB上机实习报告

Matlab上机实习实习报告十八周我们进行了本学期的第二次实习——Matlab上机实习。
本次实习一星期,共实习了五个部分。
分别是:一,Matlab基本操作;二,数值数组及其运算;三,Matlab图形绘制基础;四:SIMULINK仿真基础;五:句柄图形和图形用户界面制作。
下面分别介绍各部分内容:实习内容一Matlab基本操作1.实习目的:●掌握Matlab的启动和退出;●熟悉的命令窗口;●熟悉其它常用窗口和工具栏;2.输入一段程序: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’)输出结果:3.了解文件中的一些功能和指令.例如:clear 清除当前工作区中所有变量clc 清除指令窗内容clf 清除图形窗口cd 设置当前工作目录exit,quit 退出MATLAB实习内容二数值数组及其运算1.实习目的●掌握一维数组的创建和寻访●掌握二维数组的创建和寻访●掌握MATLAB的矩阵和数组的运算●熟悉MATLAB关系操作和逻辑操作2.要求在闭区间[0,2pi]上产生50个等距采样的一维数组A,试用两种不同的指令实现。
要访问1到5元素如何实现;寻访7到最后一个元素如何实现;寻访第2.6.8个元素如何实现;寻访大于2的元素如何实现;给第3.5.9个元素赋值100如何实现:(1)>> A=linspace(0,2*pi,50);>> A=0:(50/49):50;>> AA =Columns 1 through 90 1.0204 2.0408 3.0612 4.0816 5.1020 6.1224 7.1429 8.1633Columns 10 through 189.1837 10.2041 11.2245 12.2449 13.2653 14.2857 15.3061 16.3265 17.3469Columns 19 through 2718.3673 19.3878 20.4082 21.4286 22.4490 23.4694 24.4898 25.5102 26.5306Columns 28 through 3627.5510 28.5714 29.5918 30.6122 31.6327 32.6531 33.6735 34.6939 35.7143Columns 37 through 4536.7347 37.7551 38.7755 39.7959 40.8163 41.8367 42.8571 43.8776 44.8980Columns 46 through 5045.9184 46.9388 47.9592 48.9796 50.0000(2)>> whos A>> A(1:5)ans =0 1.0204 2.0408 3.0612 4.0816(3)>> A(7:50)ans =Columns 1 through 86.12247.14298.16339.1837 10.2041 11.2245 12.2449 13.2653Columns 9 through 1614.2857 15.3061 16.3265 17.3469 18.3673 19.3878 20.4082 21.4286Columns 17 through 2422.4490 23.4694 24.4898 25.5102 26.5306 27.5510 28.5714 29.5918Columns 25 through 3230.6122 31.6327 32.6531 33.6735 34.6939 35.7143 36.7347 37.7551Columns 33 through 4038.7755 39.7959 40.8163 41.8367 42.8571 43.8776 44.8980 45.9184Columns 41 through 4446.9388 47.9592 48.9796 50.0000(4)>> A([2 6 8])ans =1.0204 5.1020 7.1429(5)>> poison=find(A>2)poison =Columns 1 through 143 4 5 6 7 8 9 10 11 12 13 14 15 16Columns 15 through 2817 18 19 20 21 22 23 24 25 26 27 28 29 30Columns 29 through 4231 32 33 34 35 36 37 38 39 40 41 42 43 44Columns 43 through 4845 46 47 48 49 50 (6)>> A([3 5 9])=100 (7)>> A=[1 2 3;4 5 6] A =1 2 3 4 5 63. 在指令窗口输入A=[1 2 3;4 5 6] 观察结果:分别用“全坐标”“单坐标”来寻访第2行第1列的元素,并说明二维数组元素的存储顺序。
matlab实验一实验报告

matlab实验一实验报告实验一:Matlab实验报告引言:Matlab是一种强大的数学软件工具,广泛应用于科学计算、数据分析和工程设计等领域。
本实验旨在通过使用Matlab解决实际问题,探索其功能和应用。
一、实验目的本次实验的主要目的是熟悉Matlab的基本操作和常用函数,了解其在科学计算中的应用。
二、实验内容1. 数值计算在Matlab中,我们可以进行各种数值计算,包括基本的加减乘除运算,以及更复杂的矩阵运算和方程求解。
通过编写相应的代码,我们可以实现这些功能。
例如,我们可以使用Matlab计算两个矩阵的乘积,并输出结果。
代码如下:```matlabA = [1 2; 3 4];B = [5 6; 7 8];C = A * B;disp(C);```2. 数据可视化Matlab还提供了强大的数据可视化功能,可以将数据以图表的形式展示出来,更直观地观察数据的规律和趋势。
例如,我们可以使用Matlab绘制一个简单的折线图,来展示某个物体在不同时间下的位置变化。
代码如下:```matlabt = 0:0.1:10;x = sin(t);plot(t, x);xlabel('Time');ylabel('Position');title('Position vs. Time');```3. 图像处理Matlab还可以进行图像处理,包括图像的读取、处理和保存等操作。
我们可以通过Matlab对图像进行增强、滤波、分割等处理,以及进行图像的压缩和重建。
例如,我们可以使用Matlab读取一张图片,并对其进行灰度化处理。
代码如下:```matlabimg = imread('image.jpg');gray_img = rgb2gray(img);imshow(gray_img);```三、实验结果与分析在本次实验中,我们成功完成了数值计算、数据可视化和图像处理等任务。
Matlab上机实习报告

Matlab上机实习报告一、实习目的本次 Matlab 上机实习的主要目的是让我们熟悉并掌握 Matlab 软件的基本操作和应用,提高我们运用数学工具解决实际问题的能力。
通过实际的编程和计算,深入理解数学算法在计算机中的实现,培养我们的逻辑思维和创新能力。
二、实习环境实习使用的计算机操作系统为 Windows 10,安装的 Matlab 版本为R2020a。
计算机配置为:Intel Core i5 处理器,8GB 内存,512GB 固态硬盘。
三、实习内容1、矩阵运算在 Matlab 中,矩阵是最基本的数据结构。
我们首先学习了矩阵的创建、访问、修改和基本运算,如加法、减法、乘法、转置等。
通过实际的编程练习,掌握了如何利用矩阵运算解决线性方程组、求逆矩阵等问题。
例如,对于线性方程组 Ax = b,其中 A 是系数矩阵,x 是未知向量,b 是常数向量。
我们可以使用 Matlab 中的反斜杠运算符“\”来求解,即 x = A\b。
2、函数绘图Matlab 具有强大的绘图功能,能够直观地展示函数的性质和变化趋势。
我们学习了如何绘制二维和三维图形,包括折线图、散点图、柱状图、曲面图等。
通过调整绘图的参数,如线条颜色、标记形状、坐标轴范围等,可以使图形更加清晰和美观。
例如,绘制函数 y = sin(x) 在区间0, 2π 上的图像,可以使用以下代码:```matlabx = 0:001:2pi;y = sin(x);plot(x, y)```3、数值计算Matlab 提供了丰富的数值计算函数,如求积分、求导数、求解常微分方程等。
我们通过实际的案例,学会了如何运用这些函数来解决科学计算和工程中的问题。
例如,使用数值积分函数“quad”计算函数 f(x) = x^2 在区间 0, 1 上的定积分,可以使用以下代码:```matlabfunction f = myfun(x)f = x^2;endresult = quad(@myfun, 0, 1)```4、程序设计在实习过程中,我们还学习了 Matlab 的程序设计结构,包括顺序结构、选择结构(ifelse 语句)和循环结构(for 循环、while 循环)。
matlab实验一实验报告

matlab实验一实验报告一、实验目的本次实验的主要目的是熟悉 MATLAB 软件的基本操作环境和编程语法,通过实际编写和运行简单的程序,初步掌握 MATLAB 在数值计算、图形绘制和数据处理方面的基本功能。
二、实验环境本次实验使用的是 MATLAB R2020a 版本,运行在 Windows 10 操作系统上。
计算机配置为:Intel Core i5 处理器,8GB 内存。
三、实验内容及步骤1、矩阵运算创建一个 3×3 的矩阵 A,元素分别为 1 到 9。
创建一个 3×3 的零矩阵 B。
计算 A+B 和 A×B 的结果。
在 MATLAB 中,我们可以使用以下代码实现:```matlabA = 1 2 3; 4 5 6; 7 8 9;B = zeros(3);C = A + B;D = A B;disp(C);disp(D);```2、数据类型转换定义一个整数变量 x 为 5。
将 x 转换为双精度浮点数。
将 x 转换为字符串类型。
代码如下:```matlabx = 5;y = double(x);z = num2str(x);disp(y);disp(z);```3、函数调用定义一个函数 fun,输入参数为 x,返回值为 x 的平方。
调用函数 fun,计算 3 的平方。
函数定义及调用代码:```matlabfunction y = fun(x)y = x^2;endresult = fun(3);disp(result);```4、图形绘制绘制函数 y = sin(x)在区间0, 2π上的图像。
使用以下代码实现:```matlabx = 0:001:2pi;y = sin(x);plot(x, y);```四、实验结果1、矩阵运算A+B 的结果为:```matlab1 2 34 5 67 8 9```A×B 的结果为:```matlab0 0 00 0 00 0 0```2、数据类型转换将整数 5 转换为双精度浮点数,结果为 50000。
matlab实习报告总结

MATLAB实习报告总结介绍本文是对我在MATLAB实习过程中的总结与反思。
通过这次实习,我对MATLAB的使用有了更深入的了解,并且对实际问题的解决能力也有了提升。
实习目标在实习开始之前,我设定了以下几个目标: 1. 熟悉MATLAB的基本语法和常用函数; 2. 学习如何使用MATLAB解决实际问题; 3. 提升自己的编程能力和解决问题的思维能力。
实习过程第一阶段:熟悉MATLAB基本语法在实习开始之初,我花了一段时间来学习MATLAB的基本语法。
通过阅读官方文档和参考书籍,我了解了MATLAB的变量定义、矩阵运算、函数定义等基本概念和用法。
我利用空闲时间编写了一些简单的代码来巩固这些知识。
第二阶段:学习MATLAB的常用函数在熟悉基本语法之后,我开始学习MATLAB的常用函数。
我学习了MATLAB 中的统计分析函数、数据可视化函数、图像处理函数等。
通过学习这些函数,我可以更高效地处理和分析数据,同时也能够更好地展示我的结果。
第三阶段:实际问题的解决在掌握了MATLAB的基本语法和常用函数后,我开始尝试使用MATLAB解决一些实际问题。
我选择了一个与我的专业相关的问题,通过MATLAB对数据进行分析和建模。
在这个过程中,我遇到了一些困难和挑战,但通过查阅资料和请教同学,我最终成功解决了这些问题。
第四阶段:编程能力和思维能力的提升通过这次实习,我的编程能力和解决问题的思维能力得到了提升。
在实际问题的解决过程中,我学会了如何分析问题、设计算法、编写代码并调试。
通过与同学的讨论和交流,我也学会了如何思考和解决问题的不同角度。
总结与反思这次MATLAB实习让我受益匪浅。
通过实际操作,我深入了解了MATLAB的使用方法和技巧。
我学会了如何使用MATLAB解决实际问题,并且在这个过程中提升了自己的编程能力和解决问题的思维能力。
然而,我也发现了自己的不足之处。
在实习过程中,我有时会陷入“死记硬背”的状态,只注重语法和函数的使用,而不去思考问题背后的本质,这导致我在解决一些复杂问题时遇到了困难。
matlab实验报告

matlab实验报告引言:Matlab(矩阵实验室)是一款功能强大的数值计算和科学计算软件,广泛应用于工程、科学和经济等领域。
本实验报告将探讨我在使用Matlab进行实验过程中的心得体会和实验结果。
实验一:图像处理在这个实验中,我使用Matlab对一张图像进行了处理,并应用了各种图像处理算法。
这包括图像增强、边缘检测和图像分割等技术。
通过Matlab的图像处理工具箱,我能够轻松调用各种算法函数,并对图像进行快速处理。
实验结果表明,Matlab图像处理工具箱提供了丰富的函数和算法,极大地方便了我们的图像处理工作。
实验二:模拟信号处理模拟信号处理是Matlab中的一个重要应用领域。
在这个实验中,我模拟了一个带噪声的正弦信号,并使用Matlab进行了噪声滤波和频谱分析。
通过使用Matlab的滤波函数,我能够有效地去除信号中的噪声,并还原出原始信号。
同时,Matlab提供了功能强大的频谱分析工具,我可以轻松地对信号的频率特性进行分析和可视化。
实验三:数据分析与统计数据分析与统计是Matlab的另一个重要应用领域。
在这个实验中,我使用Matlab对一组实验数据进行了分析和统计。
通过使用Matlab的统计函数和工具,我能够计算出数据的均值、方差、标准差等统计指标,并绘制出数据的直方图和散点图。
这些统计分析结果对我的实验研究提供了有力的支持,并帮助我更好地理解实验数据。
实验四:数值计算与优化数值计算与优化是Matlab的核心功能之一。
在这个实验中,我使用Matlab进行了一组数值计算和优化实验。
通过使用Matlab的数值计算函数和优化工具箱,我能够快速计算出复杂的数学问题,并找到最优解。
同时,在进行优化实验时,我可以设置各种约束条件和目标函数,从而得到最优解的参数值。
这些数值计算和优化工具极大地提高了我的研究效率和准确度。
结论:通过这些实验,我深刻认识到Matlab的强大功能和广泛应用领域。
无论是图像处理、信号处理、数据分析还是数值计算与优化,Matlab都提供了丰富的函数和工具,让我们能够快速高效地完成实验和研究工作。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
一、实训目的1. 熟悉MATLAB语言的使用2. 了解MATLAB在电子信息课程中的应用3. 掌握MATLAB矩阵输入、运算以及MATLAB数值的运算功能4.掌握各种数据的创建、访问、扩建及缩减5.了解利用MATLAB计算系统响应的方法;验证信号与系统的基本概念、基本理论,掌握信号与系统的分析方法。
二、实训任务和要求1、熟练利用MATLAB语言编程对系统S平面分析2、掌握利用MATLAB分析系统时域的方法,熟悉系统的零输入响应,零状态响应及冲击响应的步骤。
3、MATLAB是目前国际上最流行,应用最广泛的科学与工程计算软件,它由MATLAB语言,MATLAB工作环境,MATLAB图像处理系统,MATLAB数据函数库,MATLAB应用程序接口五大部分组成的集数值计算,图形处理,程序开发为一体的功能强大的系统.它应用于自动控制,数学计算,信号分析,计算机技术,图像信号处理,财务分析,航天工业,汽车工业,生物医学工程,语音处理和雷达工程等各行业,也是国内高校和研究部门进行许多科学研究的重要工具。
MATLAB的基本数据单位是矩阵,它的指令表达式与数学,工程中常用的形式十分相似,故用MATLAB来解算问题要比用C,FORTRAN等语言完相同的事情简捷得多。
MATLAB是“矩阵实验室”(MATrix LABoratoy)的缩写,它是以矩阵运算为基础的交互式程序语言,能够满足科学、工程计算和绘图的需求。
与其它计算机语言相比,其特点是简洁和智能化,适应科技专业人员的思维方式和书写习惯,使得编程和调试效率大大提高。
它用解释方式工作,键入持续后立即得出结果,人机交互性能好,易于调试并被科技人员所乐于接受。
特别是它可适应多种平台,并且随着计算机硬软件的更新及时升级,因此MATLAB语言在国外的大学工学院中,特别是频繁进行数值计算的电子信息类学科中,已经成为每个学生都掌握的工具了。
它大大提高了课程教学、解题作业、分析研究的效率。
4、系统S平面分析的基本理论MATLAB在系统S平面分析中,一般是求系统函数的零极点分布图,画单位冲激响应和幅频响应的图形,通常按常规方法这些波形很难画出,但是应用MATLAB就可简便快捷的画出图形,使系统的分析更加便捷.例如,已知系统函数为H,利用MATLAB画出该系统的零极点分布图,求出该系统的单位冲激响应和幅频响应,并判断系统的稳定性。
源程序如下:> > % program 2 Impulse response,amp;itudefequency response and stability analysis of LTI H(s)>>Bum=[1];den=[1 2 2 1];>>sys=tf(Bum,den);>>poles=roots(den):>>figure(1);pzmap(sys);t=O: 0.02: 10:>>h=impulse(Bum,den,t);>>figure(2);plot(t,h);>>xlabel( t(s) );ylabel( h(t) );title( Im—pulse Response );>>[H,W]=freqs(Bum,den);>>figure(3);plot(W,abs(H));>>xlabel( ang.freq.\omega(rad/s) );yla—bel( H(j\omega) );title( Magnitude Respone );> grid on程序运行的结果如图一,图二,图三所示:图一系统函数零极点分布图形图二系统的单位冲激响应图三系统的幅频响应5、MATLAB系统时域求解的基本函数求取系统单位阶跃响应:step()求取系统的冲激响应:impulse()y=step(num,den,t):其中num和den分别为系统传递函数描述中的分子和分母多项式系数,t为选定的仿真时间向量,一般可以由t=0:step:end等步长地产生出来。
该函数返回值y为系统在仿真时刻各个输出所组成的矩阵[y,x,t]=step(num,den):此时时间向量t由系统模型的特性自动生成, 状态变量x返回为空矩阵。
[y,x,t]=step(A,B,C,D,iu):其中A,B,C,D为系统的状态空间描述矩阵,iu用来指明输入变量的序号。
x为系统返回的状态轨迹。
impulse()函数的用法求取脉冲激励响应的调用方法与step()函数基本一致。
y=impulse(num,den,t);[y,x,t]=impulse(num,den);[y,x,t]=impulse(A,B,C,D,iu,t)covar:连续系统对白噪声的方差响应initial:连续系统的零输入响应lsim:连续系统对任意输入的响应对于离散系统只需在连续系统对应函数前加d就可以,如dstep,dimpulse等。
三、实训过程与内容1、采用的软件及开发平台MATLAB7.0 计算机2、系统的详细设计(一)、MATLAB中系统S平面分析的基本函数(a)Laplace拉普拉斯变换语法:laplace(F)laplace(F,t)fourier(F,w,z)简介:L = laplace(F)表示对F函数关于默认自变量t做拉普拉斯变换。
默认结果是关于s的函数。
拉普拉斯变换完成了时域函数到频域函数的转换。
L= laplace(F,t) 会令L为t的函数,而非默认的s。
L = laplace(F,w,z)规定F是关于w的函数,而L是关于z的函数。
(b) ilaplace 拉普拉斯逆变换 用法:F = ilaplace(L) F = ilaplace(L,y) F = ilaplace(L,y,x) 简介:F = ilaplace(L)将L(s)变换成F(t)F = ilaplace(L,y)将L(s)变换为F(y),而非F(t) F = ilaplace(L,y,x)将L(y)变换为F(x)(二)分析与实现(1)由系统函数零、极点分布决定时域特性当H(s)极点(一阶)p j σω=+中σ和ω的取值为0.06:0.03:0.06σ=-,0.5:0.25:0ω=-时,画出对应于h(t)波形,并分析波形。
解:首先,根据s 域的函数H(S),做拉普拉斯逆变换求出时域函数h(t) ,绘制h(t)的图形。
代码及波形图如下:(1)clear;clc (2)clear;clc (3)clear;clcsyms s; syms s;syms s;H=1/(s-(-0.06+0.5*j)); H=1/(s-(-0.06+0.25*j));H=1/(s+0.06);h=real(ilaplace(H)); h=real(ilaplace(H));h=real(ilaplace(H));ezplot(h) ezplot(h) ezplot(h)(4)clear;clc (5)clear;clc (6)clear;clcsyms s; syms s; syms s;H=1/(s-(-0.03+0.5*j)); H=1/(s-(-0.03+0.25*j));H=1/(s+0.03);h=real(ilaplace(H)); h=real(ilaplace(H));h=real(ilaplace(H));ezplot(h) ezplot(h) ezplot(h)(7)clear;clc (8)clear;clc (9)clear;clcsyms s; syms s; syms s;H=1/(s-0.5*j); H=1/(s-0.25*j); H=1/s;h=real(ilaplace(H)); h=real(ilaplace(H));h=real(ilaplace(H));ezplot(h) ezplot(h) ezplot(h)(10)clear;clc (11)clear;clc (12)clear;clcsyms s; syms s; syms s;H=1/(s-(0.03+0.5*j)); H=1/(s-(0.03+0.25*j));H=1/(s-0.03);h=real(ilaplace(H)); h=real(ilaplace(H));h=real(ilaplace(H));ezplot(h) ezplot(h)ezplot(h)(13)clear;clc (14)clear;clc (15)clear;clcsyms s; syms s; syms s;H=1/(s-(0.06+0.5*j)); H=1/(s-(0.06+0.25*j));H=1/(s-0.06);h=real(ilaplace(H)); h=real(ilaplace(H));h=real(ilaplace(H));ezplot(h) ezplot(h) ezplot(h)(2)由系统函数零、极点分布决定频率特性若H(s)零极点分布如图1所示,讨论他们是何种类型的滤波器,画出其幅频特性曲线。
σj ω⨯⨯()a 0σj ω⨯()b ⨯0σj ω⨯()c ⨯0σj ω⨯⨯()d 0σj ω⨯⨯0j ω0j ω-0σj ω⨯⨯()e 1j ω1j ω-1j ω1j ω-2j ω-2j ω2j ω2j ω- 系统零极点分布图(a) 低通滤波器clear;clcw=0:0.01:5;w1=0;w2=0;k=0;H=1./(((w-w1)*i+(k+1)).* ((w-w2)*i+(k+2)));plot(w,H)(b) 低通滤波器clear;clcw=0:0.01:5;w1=0;w2=0;k=0;H=(w+3)./(((w-w1)*i+(k+1)).* ((w-w2)*i+(k+2))); plot(w,H)(c) 低通滤波器clear;clcw=0:0.01:5;H=(w+3)./((w*i+1).*(w*i+2));plot(w,H)(d) 带通滤波器clear;clcw=0:0.01:5;w1=2;w2=-2;k=0;H=w./(((w-w1)*i+(k+1)).* ((w-w2)*i+(k+2)));plot(w,H)(e) 高通滤波器clear;clcw=0:0.01:5;w1= 2;w2=-2;o1=3;o2=-3;k=0;H=(w-o1).*(w-o2)./(((w-w1)*i+(k+1)).* ((w-w2)*i+(k+2)));plot(w,H)grid on(f) 高通滤波器clear;clcw=0:0.01:5;w1=2;w2=-2;o1=3;o2=-3;k=0;H=(w-o1).*(w-o2)./(((w-w1)*i+(k+1)).* ((w-w2)*i+(k+2)));plot(w,H)grid on(3)、零输入响应与零状态响应零输入响应:就是系统中的输入至始至终都是0,电路反应完全靠电路中的储能设备(电容电感)来释放能量。