Change variable value in the workspace using switch

3 次查看(过去 30 天)
How to change a variable value in the workspace using simulink's Toggle/Rotary Switch block?

回答(2 个)

Sulaymon Eshkabilov
移动: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