Accessing Simulink Model using M script
조회 수: 8 (최근 30일)
이전 댓글 표시
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!!
댓글 수: 0
답변 (1개)
Fangjun Jiang
2020년 7월 2일
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Create Large-Scale Model Components에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!