Change variable value in the workspace using switch

10 ビュー (過去 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.
  1 件のコメント
Ari
Ari 2025 年 4 月 28 日
Can't connect a Switch to To Workspace block

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by