Change variable value in the workspace using switch

How to change a variable value in the workspace using simulink's Toggle/Rotary Switch block?

답변 (2개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2025년 4월 27일
이동: Image Analyst 2025년 4월 27일

0 개 추천

Why not to assign a variable name to a constant block, then initialize the value of the constant block from the command window or MATLAB script.

댓글 수: 3

The goal here is how to select variant subsystem/model using Rotary Switch
Also, if we assign a variable name to a Constant block, then a Switch can't connect to it
If we use this approach, changing Switch position doesn't immediately change out.simout value

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

Walter Roberson
Walter Roberson 2025년 4월 27일

0 개 추천

Send the output of the Switch block into a To Workspace block.

카테고리

도움말 센터File Exchange에서 Modeling에 대해 자세히 알아보기

질문:

Ari
2025년 4월 27일

댓글:

Ari
2025년 4월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by