?? zpole.m
字號:
%===========================================================
% 程序名:zpole.m
% 本程序繪制系統(tǒng)函數(shù)的零點、極點在s平面上的分布圖,同時繪制
% 出系統(tǒng)的沖擊響應(yīng)曲線。
% A:系統(tǒng)函數(shù)分母多項式系數(shù)向量,實驗者從鍵盤上輸入
% B:系統(tǒng)函數(shù)分子多項式系數(shù)向量,實驗者從鍵盤上輸入
% p:函數(shù)返回的系統(tǒng)函數(shù)極點位置行向量
% q:函數(shù)返回的系統(tǒng)函數(shù)零點位置行向量
%===========================================================
clear;
b=input('Type in the coefficient vector of numerator polynomial:');
a=input('Type in the coefficient vector of denominator polynomial:');
p=roots(a); %求系統(tǒng)極點
q=roots(b); %求系統(tǒng)零點
p=p'; %將極點列向量轉(zhuǎn)置為行向量
q=q'; %將零點列向量轉(zhuǎn)置為行向量
x=max(abs([p q])); %確定縱坐標范圍
x=x+1;
y=x; %確定橫坐標范圍
clf
subplot(2,2,1);
axis([-x x -y y]); %確定坐標軸顯示范圍
axis('square')
plot([-x x],[0 0]);hold on; %畫橫坐標軸
plot([0 0],[-y y]);hold on; %畫縱坐標軸
plot(real(p),imag(p),'x');hold on; %畫極點
plot(real(q),imag(q),'o');hold on; %畫零點
grid on;
title('zero-pole diagram');
xlabel('real axis');ylabel('imaginal axis')
text(0.1*max(x),max(y),'jw')
%===========================================================
% 繪制沖激響應(yīng)曲線
%===========================================================
subplot(2,2,2);
impulse(b,a);
xlabel('time');
ylabel('amplitude');
title('impulse response')
grid on;
%============================================================
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -