Model Compilation Through M-Script
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Rahul
el 4 de Oct. de 2019
Comentada: Rahul
el 9 de Oct. de 2019
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 comentarios
Respuesta aceptada
Fangjun Jiang
el 4 de Oct. de 2019
Editada: Fangjun Jiang
el 4 de Oct. de 2019
sort_slx_files(i).name is a string, that is the cause of the error.
use eval([sort_slx_files(i).name,'([],[],[],''compile'');']);
3 comentarios
Fangjun Jiang
el 4 de Oct. de 2019
Editada: Fangjun Jiang
el 4 de Oct. de 2019
also, don't forget to run eval([sort_slx_files(i).name,'([],[],[],''term'');']); and close_system().
Más respuestas (0)
Ver también
Categorías
Más información sobre Programmatic Model Editing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!