信号处理仿真(MATLAB)实验
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
信号处理仿真(MATLAB)
实验指导书
青岛大学自动化工程学院电子工程系
2006年4月
MATLAB 实验一
一、实验目的:
1. Be familiar with MATLAB Environment
2. Be familiar with array and matrix
3. Be familiar with MATLAB operations and simple plot function
二、实验内容:
1. Be familiar with Matlab 6.5
Startup Matlab 6.5, browse the major tools of the Matlab desktop ⏹ The Command Windows
⏹ The Command History Windows ⏹ Launch Pad
⏹ The Edit/Debug Window ⏹ Figure Windows
⏹ Workspace Browser and Array Editer ⏹ Help Browser
⏹ Current Directory Browser
PART I:下列选择练习,不需提交实验报告
1. Give the answer of the following questions for the array
1.10.0
2.1
3.50.01.16.62.83.4
12.10.10.30.41.31.4
5.1
0.0
1.10.0
a r r a y -⎡⎤
⎢
⎥-⎢⎥=
⎢⎥-⎢
⎥-⎣⎦ 1)What is the size of array1?
2)What is the value of array1(4,1)?
3)What is the size and value of array1(:,1:2)?
4) What is the size and value of array1([1 3], end)? 2. Give the answer of the following commad 1) a=1:2:5; 2) b=[a ’ a ’ a ’]; 3) c=b(1:2:3,1:2:3); 4) d=a+b(2,:) 5) w=[zeros(1,3) ones(3,1)’ 3:5’] 3. Give the answer of the sub-arrays
1.10.0
2.1
3.50.01.16.62.83.4
12.10.10.30.41.31.4
5.1
0.0
1.10.0
a r r a
y -⎡⎤
⎢
⎥-⎢⎥=⎢⎥-⎢
⎥-⎣⎦ 1) array1(3,:); 2) array1(:,3); 3) array1(1:2:3,[3 3 4]) 4) array1([1 1],:)
4. Give the answer of the following operations 2
2111
,,,(2)
1
20
22
a b c d e y e --⎡⎤⎡
⎤⎡⎤====⎢
⎥⎢⎥⎢⎥--⎣⎦⎣
⎦⎣⎦ 1) a+b 2) a*d 3) a.*d 4) a*c
5) a.*c 6)a\b 7) a.\b 8)a.^b
PART I:下列选择练习,不需提交实验报告
1.Edit & Run the m-file
% test step response function
wn=6; kosi=[0.1:0.1:1.0 2]; figure(1); hold on for kos=kosi
num=wn^2; den=[1,2*kos*wn,wn.^2]; step(num,den)
end
hold off;
2.Edit & Run the m-file
% test plot function
x=0:pi/20:3*pi; y1=sin(x); y2=2*cos(2*x); plot(x,y1,'rv:',x,y2,'bo--');
title('Plot the Line of y=sin(2x) and its derivative'); xlabel('X axis'); ylabel('Y axis'); legend('f(x)','d/dx f(x)'); grid on;
3. Edit & Run the m-file
% test subplot and loglog function
x=0:0.1:10; y=x.^2-10.*x+26; subplot(2,2,1); plot(x,y); grid on;
subplot(2,2,2); semilogx(x,y); grid on; subplot(2,2,3); semilogy(x,y); grid on; subplot(2,2,4); loglog(x,y); grid on;
4.Edit & Run the m-file
% test max and plot function
volts=120; rs=50; rl=1:0.1:100;
amps=volts./(rs+rl); pl=(amps.^2).*rl; [maxvol,index]=max(pl); plot(rl,pl,rl(index),pl(index),'rh'); grid on;
MATLAB 实验二
一、实验目的:
1. Learn to design branch statements program
2. Be familiar with relational and logical operators
3. Practice 2D plotting