Model Compilation Through M-Script
조회 수: 3 (최근 30일)
이전 댓글 표시
My question is I got 36 models(all in slx format) present in structure array under the field 'name'.My Objective is to compile each model one after another through M-script
The script I written is as below
sort_slx_files = dir('*.slx'); The models are present in the directory
for i = 1:length(sort_slx_files)
load_system(sort_slx_files(i).name)
(sort_slx_files(i).name([],[],[],'compile'));
end
But I get the error 'Index exceeds matrix dimension'
How to resolve this error and get the objective of compiling the models one after another
댓글 수: 0
채택된 답변
Fangjun Jiang
2019년 10월 4일
편집: Fangjun Jiang
2019년 10월 4일
sort_slx_files(i).name is a string, that is the cause of the error.
use eval([sort_slx_files(i).name,'([],[],[],''compile'');']);
댓글 수: 3
Fangjun Jiang
2019년 10월 4일
편집: Fangjun Jiang
2019년 10월 4일
also, don't forget to run eval([sort_slx_files(i).name,'([],[],[],''term'');']); and close_system().
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multicore Processor Targets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!