📄 dzline.m
字号:
function dzline(zeta)
% DZLINE(ZETA) draws the lines of constant damping ratio
% for a discrete-time system, where ZETA can be a scalar
% or a vector of damping ratios.
% The lines should be plotted in the z-plane.
% The hold state (on/off) will be left the way it was
% before the function was called.
%%%%%%%%%%%%%%%%%%% dzline.m %%%%%%%%%%%%%%%%%%%%
% 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 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
theta = acos(zeta);
phi = pi-theta;
r = [0:0.1:5];
[mm,nn] = size(phi);
for jj = 1:nn,
s1=r*exp(i*phi(jj)); % ray from origin in upper half of s-plane
s2=r*exp(-i*phi(jj)); % ray from origin in lower half of s-plane
z1=exp(s1); % log spiral in upper half of z-plane
z2=exp(s2); % log spiral lower half of z-plane
ii = find(imag(z1)>=0);% plot only points in upper half plane
jj = find(imag(z2)<=0);% plot only points in lower half plane
plot(z1(ii),':')
if ishold ~= 1, hold on, hold_was_off = 1; else hold_was_off = 0; end
plot(z2(jj),':')
if hold_was_off == 1, hold off, else hold on, end
end
%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -