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 件のコメント

Ari
Ari 2025 年 4 月 28 日
The goal here is how to select variant subsystem/model using Rotary Switch
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 日

0 投票

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

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

カテゴリ

ヘルプ センター および File ExchangeModeling についてさらに検索

質問済み:

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