How to callback multiple Button Groups
显示 更早的评论
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 :)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!