How to create Simulink model with multiple versions?

조회 수: 6 (최근 30일)
Tiernan Moore
Tiernan Moore 2024년 7월 24일
댓글: Les Beckham 2024년 7월 25일
I have Simulink models that are different versions of a controller. The versions change static data, used throughout the model, and some blocks in the model. I am wondering if there is a way to create one Simulink model that can be changed between all these versions. A similar functionality exists in standard Simulink functions, such as with the PID Controller when you switch the form between Parallel and Ideal or the Logical Operator switching between AND and OR. Has anyone created or found similar functionality for making Simulink models with different versions?

채택된 답변

Les Beckham
Les Beckham 2024년 7월 24일
I would suggest reading about Variant Subsystems. They are intended for doing exactly that.
  댓글 수: 2
Tiernan Moore
Tiernan Moore 2024년 7월 25일
Hi Les, thanks for bringing the variant subsystem to my attention. Do you know if there is a way to change which varient the model uses after compiling the model at the beginning of runtime?
Les Beckham
Les Beckham 2024년 7월 25일
I'm pretty sure it is possible to select the desired variant programmatically (e.g., in a script that initializes things and runs the model with the sim() function).
It has been years since I did any work with Simulink, so I don't remember off the top of my head how to do it. Seems like you set the variant selector (probably not the right name for it) to be a workspace (model or base) variable and set that in your initialization script.
Sorry I'm not more help.
If my answer addressed your initial question sufficiently, would you please Accept it?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Create Large-Scale Model Components에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by