%% get model name
%'Data.xlsx' is necessary to load model name
[~,~,rawConfig]=xlsread('Data.xlsx','Configuration');
Configsize =size(rawConfig);
% disp(Configsize(2));
for i=1:Configsize(2)
if strcmp(rawConfig{1,i},'Model_Name')
Model_Name=rawConfig{2,i};
break;
end
end
clearvars i rawConfig Configsize;
%% load system
%load system and get systempath like 'BIC_Sample/BIC_Sample_Init' and 'BIC_Sample/RctBIC_Sample_50ms_sys'
load_system(Model_Name);
SystemPath=find_system(Model_Name,'SearchDepth',1,'BlockType','SubSystem');
%% loop all subsystem
for i=1:length(SystemPath)
%is runable
if contains(SystemPath{i},'ms_sys') || contains(SystemPath{i},'1s_sys')
clearSpare(SystemPath{i});
%input port gen goto
genGF(SystemPath{i},0);
%move output port
rightBlock(find_system(Syst
simulink接口生成gotofrom
于 2023-11-15 10:34:57 首次发布
文章描述了如何使用MATLAB脚本在Simulink模型中操作,包括加载系统、查找子系统、移除备用链接和块、生成Goto和From信号路由,以及调整块的位置。

最低0.47元/天 解锁文章
995

被折叠的 条评论
为什么被折叠?



