Accessing Simulink Model using M script

8 visualizaciones (últimos 30 días)
ritu tanwar
ritu tanwar el 2 de Jul. de 2020
Respondida: Fangjun Jiang el 2 de Jul. de 2020
Hello All,
Problem : I want to get number of level present in MATLAB model ( hierarchy) throgh M script. Manually we can check in Model explorer.
and then from M script only I want to loop though at each level and get numbers of subsystem present at each level seperately. Can I do it in MATLAB ?
Please guide.
Thank you!!

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 2 de Jul. de 2020
Something like this:
Model='MyModel';
open_system(Model);
Sys=find_system(Model,'BlockType','SubSystem');
for k=1:length(Sys)
SubSys=find_system(Sys{k},'SearchDepth',1,'BlockType','SubSystem','Parent',Sys{k});
end

Categorías

Más información sobre Create Large-Scale Model Components en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by