1 Star 2 Fork 0

liuzhaoze / 自动控制原理MATLAB仿真实验

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Q3_1.m 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
liuzhaoze 提交于 2020-11-27 20:00 . 完成作业3-1
G = tf(10, [1, 2, 10]);
G1 = tf([2, 10], [1, 2, 10]);
G2 = tf([1, 0.5, 10], [1, 2, 10]);
G3 = tf([1, 0.5, 0], [1, 2, 10]);
G4 = tf([1, 0], [1, 2, 10]);
ax1 = subplot(2, 2, 1);
ax2 = subplot(2, 2, 2);
ax3 = subplot(2, 2, 3);
ax4 = subplot(2, 2, 4);
[y, t] = step(G, 6);
plot(ax1, t, y); hold(ax1, 'on');
plot(ax2, t, y); hold(ax2, 'on');
plot(ax3, t, y); hold(ax3, 'on');
plot(ax4, t, y); hold(ax4, 'on');
[y, t] = step(G1, 6); plot(ax1, t, y);
[y, t] = step(G2, 6); plot(ax2, t, y);
[y, t] = step(G3, 6); plot(ax3, t, y);
[y, t] = step(G4, 6); plot(ax4, t, y);
title(ax1, 'G_1(s)与G(s)对比'); grid(ax1, 'on');
title(ax2, 'G_2(s)与G(s)对比'); grid(ax2, 'on');
title(ax3, 'G_3(s)与G(s)对比'); grid(ax3, 'on');
title(ax4, 'G_4(s)与G(s)对比'); grid(ax4, 'on');
xlabel(ax1, 'Time (seconds)'); ylabel(ax1, 'Amplitude');
xlabel(ax2, 'Time (seconds)'); ylabel(ax2, 'Amplitude');
xlabel(ax3, 'Time (seconds)'); ylabel(ax3, 'Amplitude');
xlabel(ax4, 'Time (seconds)'); ylabel(ax4, 'Amplitude');
legend(ax1, {'G(s)','G_1(s)'});
legend(ax2, {'G(s)','G_2(s)'});
legend(ax3, {'G(s)','G_3(s)'});
legend(ax4, {'G(s)','G_4(s)'});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Matlab
1
https://gitee.com/liuzhaoze/automatic-control-MATLAB.git
git@gitee.com:liuzhaoze/automatic-control-MATLAB.git
liuzhaoze
automatic-control-MATLAB
自动控制原理MATLAB仿真实验
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891