%'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;
%% import Arxml
SWC_arxml=[Model_Name,'_swc.arxml'];
Sldd_Name=[Model_Name,'.sldd'];
SWC=['/ComponentTypes/',Model_Name];
ar = arxml.importer(SWC_arxml);
createComponentAsModel(ar,SWC,'ModelPeriodicRunnablesAs','FunctionCallSubsystem','DataDictionary',Sldd_Name);
clearvars SWC SWC_arxml ar Sldd_Name Model_Name;
disp('Success arxml imported.');
matlab导入arxml文件脚本
于 2023-11-15 09:22:10 首次发布