首先,定义传递函数:

s = tf('s');
K = [0 0.25 0.5 1 1.5 2 3];
G = K./(s.*(5.*s-1));

然后,绘制单位阶跃响应:

figure('Name','Unit Step Response');
for i=1:length(K)
    subplot(3,3,i);
    step(G(i));
    title(['K=',num2str(K(i))]);
end

绘制单位脉冲响应:

figure('Name','Unit Impulse Response');
for i=1:length(K)
    subplot(3,3,i);
    impulse(G(i));
    title(['K=',num2str(K(i))]);
end

计算极点:

p = pole(G)

判断稳定性:所有极点的实部均小于0,则系统稳定。

综合代码:

s = tf('s');
K = [0 0.25 0.5 1 1.5 2 3];
G = K./(s.*(5.*s-1));

figure('Name','Unit Step Response');
for i=1:length(K)
    subplot(3,3,i);
    step(G(i));
    title(['K=',num2str(K(i))]);
end

figure('Name','Unit Impulse Response');
for i=1:length(K)
    subplot(3,3,i);
    impulse(G(i));
    title(['K=',num2str(K(i))]);
end

p = pole(G);
disp('Poles:');
disp(p);
if real(p)<0
    disp('The system is stable.');
else
    disp('The system is unstable.');
end
``

原文地址: https://www.cveoy.top/t/topic/fiOY 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录