MATLAB腳本批量設置模型運行參數

設置模型配置參數

示例代碼如下:

function configset()
mdllist=dir([pwd,'\*.slx']);
[mdllistnum,~]=size(mdllist);
imdl=1;
while imdl<=mdllistnum
load('configuration.mat');
currmdlname=(mdllist(imdl,1).name);
load_system(currmdlname);
buildmdl=currmdlname(1:end-4);
disp([num2str(imdl),'/',num2str(mdllistnum),'----',buildmdl])
attachConfigSet(buildmdl,cs, true);
% detachConfigSet(buildmdl, 'conf_160707');
setActiveConfigSet(buildmdl, 'Configuration');
save_system(buildmdl);
close_system(buildmdl);
imdl=imdl+1;
end
end

attachConfigSet

attachConfigSet為指定模型添加配置文件

detachConfigSet

detachConfigSet刪除指定模型的配置文件

setActiveConfigSet

setActiveConfigSet激活模型中指定的配置文件

無條件地關閉任一或所有 Simulink 系統窗口bdclose

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • ORA-00001: 違反唯一約束條件 (.) 錯誤說明:當在唯一索引所對應的列上鍵入重復值時,會觸發此異常。 O...
    我想起個好名字閱讀 5,429評論 0 9
  • 國家電網公司企業標準(Q/GDW)- 面向對象的用電信息數據交換協議 - 報批稿:20170802 前言: 排版 ...
    庭說閱讀 11,123評論 6 13
  • 一、Python簡介和環境搭建以及pip的安裝 4課時實驗課主要內容 【Python簡介】: Python 是一個...
    _小老虎_閱讀 5,803評論 0 10
  • 1. 簡介 1.1 什么是 MyBatis ? MyBatis 是支持定制化 SQL、存儲過程以及高級映射的優秀的...
    笨鳥慢飛閱讀 5,571評論 0 4
  • Swift1> Swift和OC的區別1.1> Swift沒有地址/指針的概念1.2> 泛型1.3> 類型嚴謹 對...
    cosWriter閱讀 11,136評論 1 32