MATLAB制作教科书级别图表:源代码与技巧分享

视频链接:

首先建立如下Simulink模型:

视频中的脚本如下:

mdlName = 'zeroes_2ndorder';

figure('name','二阶系统增加零点后的影响','units','normalized','outerposition',[0 0 1 1]);

grid on;

legend_index=1;

hold on;

for a = [3,5,10,-3]

    disp(['Running Test Cycle with a =',num2str(a)]);

    load_system(mdlName);

    cs = getActiveConfigSet(mdlName);

    model_cs = cs.copy;

    set_param(model_cs,'MaxStep','0.01');

    simOut = sim(mdlName,model_cs);

    hplot(legend_index)=plot(simOut.logsout{1}.Values);

    hold on;

    legendInfo{legend_index}=(['a=',num2str(a)]); % or whatever is appropriate

    legend(hplot(1:legend_index), legendInfo(1:legend_index));

    drawnow();

    legend_index=legend_index+1;

end

hplot(legend_index)=plot(simOut.logsout{2}.Values);

hold on;

legendInfo{legend_index}=('no zero 2nd order system'); % or whatever is appropriate

legend(hplot(1:legend_index), legendInfo(1:legend_index));

drawnow();

title('Effect of adding a zero to a two-pole system');

xlabel('Time(seconds)','FontAngle','italic');

ylabel('Normalized c(t)','FontAngle','italic');

QR Code
微信扫一扫,欢迎咨询~

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 155-2731-8020
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

手机不正确

公司不为空