![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176755/image.png)
How to choose option using radio buttons?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Alicja Krawczynska
am 19 Jan. 2017
Kommentiert: Alicja Krawczynska
am 20 Jan. 2017
Hello, I'm Matlab newbie in the middle of creating my school project. I'd like to create little app in GUI to help creating card deck for World of Warcraft. I want to be able to choose one of two sides of conflict and then choose one of champion classes (both using radio buttons). But I have no idea how to make my program understand all the choices to make. It should go like that: Step1: Choose your side. Step2: Choose your class. Program should remember it and use it later to customize deck. Help!
0 Kommentare
Akzeptierte Antwort
Jorge Mario Guerra González
am 20 Jan. 2017
You mean you want to get an outcome from the radiobutton clicking?
Radiobutton 1 Callback
function radiobutton1_Callback(hObject, eventdata, handles)
set(handles.radiobutton2,'Value',0);
disp(1);
guidata(hObject, handles);
Radiobutton2 Callback
function radiobutton2_Callback(hObject, eventdata, handles)
set(handles.radiobutton1,'Value',0);
disp(2);
guidata(hObject, handles);
When you choose either option shows the respective number at the workspace.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176755/image.png)
%
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!