How to callback multiple Button Groups
Mostrar comentarios más antiguos
I have 4 radio buttons and a static text in my Matlab GUI. I want my text window to update its string every time the radio buttons are selected. I inserted the firs two radio buttons in a button group and the other two into another button group because the total outcome possibilities should be 4.
I searched for hours and could not come up with any way to have an if-else statement which takes its values from the radio button's state (1 for selected and 0 for not selected). I tried inserting the two button groups into a new button group and write my if statements inside the new group callback but it did not work.
This is also how i coded my if-else statement:
if hObject==handles.radiobutton1 && hObject==handles.radiobutton3
set(handles.text1,'String','outcome1')
elseif hObject==handles.radiobutton1 && hObject==handles.radiobutton4
set(handles.text1,'String','outcome2')
....
....
....
New matlab user here please explain on low level :)
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Environment and Settings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!