Change variable value in the workspace using switch

조회 수: 4 (최근 30일)
Ari
Ari 2025년 4월 27일
댓글: Ari 2025년 4월 28일
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일
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
Ari
Ari 2025년 4월 28일
Also, if we assign a variable name to a Constant block, then a Switch can't connect to it
Ari
Ari 2025년 4월 28일
If we use this approach, changing Switch position doesn't immediately change out.simout value

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


Walter Roberson
Walter Roberson 2025년 4월 27일
Send the output of the Switch block into a To Workspace block.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by