?? ex_2.m
字號:
%ex_2
clear all;
a=[3 -1 0 0 0 1];
b=[1 1];
%
p=roots(a) %求系統極點
z=roots(b) %求系統零點
p=p'; %將極點列向量轉置為行向量
z=z'; %將零點列向量轉置為行向量
x=max(abs([p z 1])); %確定縱坐標范圍
x=x+0.1;
y=x; %確定橫坐標范圍
figure(1)
clf
hold on
axis([-x x -y y]) %確定坐標軸顯示范圍
w=0:pi/300:2*pi;
t=exp(i*w);
plot(t) %畫單位園
axis('square')
plot([-x x],[0 0]) %畫橫坐標軸
plot([0 0],[-y y]) %畫縱坐標軸
text(0.1,x,'jIm[z]')
text(y,1/10,'Re[z]')
plot(real(p),imag(p),'x') %畫極點
plot(real(z),imag(z),'o') %畫零點
title('pole-zero diagram for discrete system') %標注標題
hold off
%
[z,p]=tf2zp(b,a)
figure(2)
zplane(z,p),title('pole-zero diagram for discrete system')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -