📄 cp81.m
字号:
clf % Clear graph on screen.
numgh=[.21]; % Define numerator of G(s)H(s).
dengh=[3.984e-007 0.0001931 1.292 0]; % Define denominator of G(s)H(s).
'G(s)H(s)' % Display label.
GH=tf(numgh,dengh) % Create G(s)H(s) and display.
rlocus(GH) % Draw root locus.
z=0.2:0.05:0.5; % Define damping ratio values: 0.2 to
% 0.5in steps of 0.05.
wn=0:1:10; % Define natural frequency values: 0
% to 10 in steps of 1.
sgrid(z,wn) % Generate damping ratio and natural
% frequency grid lines for root
% locus.
title('Root Locus') % Define title for root locus.
pause
rlocus(GH) % Draw close-up root locus.
axis([-3 1 -4 4]) % Define range on axes for root locus
% close-up view.
title('Close-up') % Define title for close-up root
% locus.
z=0.45; % Define damping ratio line for
% overlay on close-up root locus.
wn=0; % Suppress natural frequency overlay
% curves.
sgrid(z,wn) % Overlay damping ratio curve on
% close-up root locus.
for k=1:3 % Loop allows 3 points to be selected
% as per Example 8.7
% (z=0.45, jw crossing, breakaway).
[K,p]=rlocfind(GH) % Generate gain, K, and closed-loop
% poles, p,
% for point selected interactively on
% the root locus.
end % End loop.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -