Change variable value in the workspace using switch

3 vues (au cours des 30 derniers jours)
Ari
Ari le 27 Avr 2025
Commenté : Ari le 28 Avr 2025
How to change a variable value in the workspace using simulink's Toggle/Rotary Switch block?

Réponses (2)

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 27 Avr 2025
Déplacé(e) : Image Analyst le 27 Avr 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 commentaires
Ari
Ari le 28 Avr 2025
Also, if we assign a variable name to a Constant block, then a Switch can't connect to it
Ari
Ari le 28 Avr 2025
If we use this approach, changing Switch position doesn't immediately change out.simout value

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 27 Avr 2025
Send the output of the Switch block into a To Workspace block.
  1 commentaire
Ari
Ari le 28 Avr 2025
Can't connect a Switch to To Workspace block

Connectez-vous pour commenter.

Catégories

En savoir plus sur Modeling dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by