📄 ex9_1.m
字号:
%%%%%%%%%%%%%%%%%% Example 9.1 %%%%%%%%%%%%%%%%%%
% Discrete-Time Control Problems using %
% MATLAB and the Control System Toolbox %
% by J.H. Chow, D.K. Frederick, & N.W. Chbat %
% Brooks/Cole Publishing Company %
% September 2002 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ---- Frequency-response plots of G(z) and G(w) ----
%
clear
disp('Example 9.1')
num = 4 % numerator
den = conv([2 1],[0.5 1]) % denominator
Gp = tf(num,den) % continuous lti object
Ts = 0.1 % sampling time
Gz = c2d(Gp,Ts,'zoh') % discretization
Gw = d2c(Gz,'tustin') % bilinear transform
disp('******>'), pause
figure, bode(Gz),grid
title('Frequency response of G(z)')
disp('Click on the frequency response curves to find')
disp('frequency response values')
disp('******>'), pause
figure, bode(Gw,logspace(-1,4,100)),grid
title('Frequency response of G(w)')
disp('Click on the frequency response curves to find')
disp('frequency response values')
disp('******>'), pause
w = 5*pi
ww = 2/Ts*tan(w*Ts/2)
[magz,phz] = bode(Gz,w) % find magnitude and
[magw,phw] = bode(Gw,ww) % ... phase
%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -