Change variable value in the workspace using switch

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

Antworten (2)

Sulaymon Eshkabilov
Sulaymon Eshkabilov am 27 Apr. 2025
Verschoben: Image Analyst am 27 Apr. 2025

0 Stimmen

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 Kommentare

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

Melden Sie sich an, um zu kommentieren.

Walter Roberson
Walter Roberson am 27 Apr. 2025

0 Stimmen

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

Kategorien

Mehr zu Modeling finden Sie in Hilfe-Center und File Exchange

Gefragt:

Ari
am 27 Apr. 2025

Kommentiert:

Ari
am 28 Apr. 2025

Community Treasure Hunt

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

Start Hunting!

Translated by