matlab完整程序,急!大佬帮帮孩子吧

 

clear; clc;
% (1)
Gs = 1.5 * feedback( ...
    tf([1, 0.5], [1, 0.1]) * ...
    tf(20, [1, 12, 20, 0]), -1)
% (2)
[zero_point, pole_point, gain] = ...
    tf2zp(Gs.Numerator{1}, Gs.Denominator{1});
stability = true;
zp = [zero_point; pole_point];
for tmp = 1:length(zp)
    if (zp(tmp) >= 0)
        stability = false;
    end
end
if (stability)
    disp("稳定");
else 
    disp("不稳定");
end
clear stability zp tmp;
% (3)
rlocus(Gs)
locus = rlocus(Gs);
[m, n] = size(locus);
for mi = 1:m
    for ni = 1:n
        if (abs(real(locus(mi, ni))) < 0.06)
            % 筛选可能的点,看根轨迹图能找到和虚轴的交点
            disp(locus(mi, ni));
        end
    end
end
clear m mi n ni locus;
% (4)
fig = figure("Name", "responese");
subplot(2, 2, 1); hold on;
impulse(tf(1, 1), 1.5);
impulse(tf([1, 0], 1)*Gs, 1.5);
title("impulse response");
legend("input", "output"); grid on;
subplot(2, 2, 2); hold on;
step(tf(1, 1), 1.5)
step(Gs, 1.5);
title("step response");
legend("input", "output"); grid on;
subplot(2, 2, 3); hold on;
step(tf(1, [1, 0]), 1.5)
step(tf(1, [1, 0])*Gs, 1.5);
title("step response");
legend("input", "output"); grid on;

最后一个脉冲、阶跃、斜坡只有三个啊?第四个也不知道画啥。望采纳。

您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632