Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

In the group of buttons 1 to 9, what code should I use to print 0 if none of the buttons is selected, or if one is selected?

1 vue (au cours des 30 derniers jours)
Tugba Ergin
Tugba Ergin le 13 Fév 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
In the group of buttons 1 to 9, what code should I use to print 0 if none of the buttons is selected, or if one is selected?
I want to use '' if else'' but when radio buttons become nonselected, value should show the zero value??

Réponses (1)

Walter Roberson
Walter Roberson le 13 Fév 2019
if you are using a uibuttongroup then check isempty() the Selected property of the group.
  2 commentaires
Tugba Ergin
Tugba Ergin le 14 Fév 2019
how should be the code?
name of my button groups is valanceoptions. if i don't select any button, it should write 0, or any other button 1, 2, .. 9 it should write selected one ??

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by