闽江学院电子系
实验报告
学生姓名:
班级:
学号:
课程:MATLAB程序设计
实验题目:MATLAB操作基础
实验地点:实验楼A210
实验目的:
1、熟悉MATLAB的操作环境及基本操作方法。
2、掌握MATLAB的搜索路径及其设置方法。
3、熟悉MATLAB帮助信息的查阅方法。
实验内容:
1、先建立自己的工作目录,再将自己的工作目录设置到MATLAB搜索路径下,再试验用help命令能否查询到自己的工作目录。
2、在MATLAB环境下验证例1-1至1-4,并完成以下题目:
(1)绘制右图所示图形
(2)求
3、利用MATLAB的帮助功能分别查询inv,plot、max、round等函数的功能及用法。
4、在工作空间建立一个变量a ,同时在当前目录下建立一个M文件:,试在命令窗口输入a,观察结果,并解释原因。
实验环境(使用的软硬件):
MATLAB
实验结果:
实验程序:
(1)求。
程序:
x=8;
plot(x, x^(1/3));
得到的结果:
ans=
2
(2)绘制图像
程序:
x=[0::1];
plot(x, sin(2*pi*x),x, 2*x-1,x,0);
得到结果如下图:
(3)查询plot、inv、round、max等函数的功能及用法
分别输入:
输入:help plot
得到:
PLOT Linear plot.
PLOT(X,Y) plots vector Y versus vector X. If X or Y is a matrix,
then the vector is plotted versus the rows or columns of the matrix,
whichever line up. If X is a scalar and Y is a vector, length(Y)
disconnected points are plotted.
PLOT(Y) plots the columns of Y versus their index.
If Y plex, PLOT(Y) is equivalent to PLOT(real(Y),imag(Y)).
In all other uses of PLOT, the imaginary part is ignored.
Various line types, plot symbols and colors may be obtained with
PLOT(X,Y,S) where S is a character string made from one element
from any or all the following 3 columns:
b blue . point - solid
g green o ci
实验一MATLAB操作基础实验报告 来自淘豆网m.daumloan.com转载请标明出处.