Dynamic number of Simulink blocks, is it possible?

조회 수: 4 (최근 30일)
Benjamin
Benjamin 2011년 3월 12일
Is it possible to have simulink model that contains a dynamic number of blocs? E.g. have a model that creates N simulink subsystems of some given type? And how is this done?
Thanks :)
Benjamin

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 3월 13일
You can use add_block to programmatically add blocks to a Simulink model. However, you cannot do this while the model is executing (because during this time, the model is locked by the engine, as it needs to be able to rely on the information from model compile).
  댓글 수: 3
Benjamin
Benjamin 2011년 3월 13일
Awesome, thanks, that makes sense! How do you programmatically make the connections?
Paulo Silva
Paulo Silva 2011년 3월 13일
You can add User-defined blocks to your model and use the set_param function inside them to change the state of switches.
The embedded function block is probably the easy way but Level-2 M-file
S-Function block also work.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by