How to change global variable value with radio button?
Afficher commentaires plus anciens
I have 2 group button like this, and global variables where d_u and d_a must changed if Data test and performance goal clicked.

how to change global variable value if one of the button clicked?
help me please :)
2 commentaires
Geoff Hayes
le 25 Fév 2019
Angaa - you will need a callback for your radio button group. But do you really need a global variable? Have you created your GUI with GUIDE, App Designer, or programmatically?
Réponses (1)
Geoff Hayes
le 26 Fév 2019
1 vote
Angga - instead of putting your radio buttons in a panel (which I think you may have done but I can't be sure) you would use a Button Group instead. So from the GUIDE editor, you would select the Button Group control/widget and drag it on to your GUI. You would then place the radio buttons within this group. See Button Group Callbacks for how to add a callback to this group so that the callback will fire whenever a radio button (from that group) is changed.
An alternative to global variables is to use the handles structure that is passed around to all callbacks in your GUI. See Store or retrieve UI data for details.
Catégories
En savoir plus sur Interactive Control and Callbacks dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!