Scilab2023简单的尝试

因为种种原因,不能使用Matlab,就接触到了Scilab,有一阵子没有使用了,突然发现被达索收购了。

随便抄一段代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
clear, clc, clf;
wn = 2;
instants = 0:0.05:20;
kexi = [0.1, 0.5, 1.0, 2.0];
for i = 1:length(kexi)
    s = poly(0, 's');
    h = wn^2 / (s^2 + 2*kexi(i)*wn*s+wn^2);
    s1 = syslin('c', h);
    y = csim('step', instants, s1);
    y1(i, 1:length(y)) = y;
    z = csim('imp', instants, s1);
    z1(i, 1:length(z)) = z;
end
clf(0);
scf(i);
show_window();
xsetech([0.0, 0.0, 1.01, 0.51]);
plot("onn", instants', y1')
xtitle("阶跃响应","t","y");xgrid()
legend(["ξ=0.1";"ξ=0.5";"ξ=1";"ξ=2"])
xsetech([0.0, 0.5, 1.0, 0.5]);
plot("onn", instants', z1')
xtitle("脉冲响应","t","y");xgrid()
legend(["ξ=0.1";"ξ=0.5";"ξ=1";"ξ=2"])

  运行后的效果如下:

 

 尝试一下,调整坐标显示的字体大小,新版是可以调整了的。

 

posted @   颜秋哥  阅读(146)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示