Change variable value in the workspace using switch

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

Risposte (2)

Sulaymon Eshkabilov
Sulaymon Eshkabilov il 27 Apr 2025
Spostato: Image Analyst il 27 Apr 2025
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 Commenti

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

Accedi per commentare.

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

Categorie

Scopri di più su Modeling in Centro assistenza e File Exchange

Richiesto:

Ari
il 27 Apr 2025

Commentato:

Ari
il 28 Apr 2025

Community Treasure Hunt

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

Start Hunting!

Translated by