?? d_zpole.m
字號(hào):
% Name:d_zpolse.m
% The function to draw the pole-zero diagram and the impulse response for discrete system
clear;
A=input('Type in the coefficient vector of denominator polynomial:');
B=input('Type in the coefficient vector of numerator polynomial:');
p=roots(A); %求系統(tǒng)極點(diǎn)
q=roots(B); %求系統(tǒng)零點(diǎn)
p=p'; %將極點(diǎn)列向量轉(zhuǎn)置為行向量
q=q'; %將零點(diǎn)列向量轉(zhuǎn)置為行向量
x=max(abs([p q 1])); %確定縱坐標(biāo)范圍
x=x+0.1;
y=x; %確定橫坐標(biāo)范圍
clf
subplot(2,1,1)
hold on
axis([-x x -y y]) %確定坐標(biāo)軸顯示范圍
w=0:pi/300:2*pi;
t=exp(i*w);
plot(t) %畫單位園
axis('square')
plot([-x x],[0 0]) %畫橫坐標(biāo)軸
plot([0 0],[-y y]) %畫縱坐標(biāo)軸
text(0.1,x,'jIm[z]')
text(y,1/10,'Re[z]')
plot(real(p),imag(p),'x') %畫極點(diǎn)
plot(real(q),imag(q),'o') %畫零點(diǎn)
title('The pole-zero diagram') %標(biāo)注標(biāo)題
hold off
subplot(2,1,2)
impz(B,A);
title('The impulse response h(n)')
xlabel('Time index n')
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -