How verify that a RadioButton is Checked?

4 vues (au cours des 30 derniers jours)
Giuseppe migliarese
Giuseppe migliarese le 12 Fév 2011
Hi, this is my first post, i'm learnin' to use Matlab, and in particular to programming the Gui. My question is: How can i make a control on a radiobutton in order to verify that it is checked? Something like
if(radioButton1.isChecked())... else..
thank you!:)

Réponse acceptée

Jiro Doke
Jiro Doke le 12 Fév 2011
Use uicontrol (with style 'radiobutton') to create a radio button.
h = uicontrol('Style', 'radiobutton');
Then check the "Value" property to see if it is checked or not.
v = get(h, 'Value')

Plus de réponses (1)

Giuseppe migliarese
Giuseppe migliarese le 14 Fév 2011
Really Thank you!
  1 commentaire
Jan
Jan le 14 Fév 2011
Thanking is very polite. Accepting the answer is helpful for others in addition.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by