How to put radiobutton in GUI to cycle if?

12 views (last 30 days)
Dear all,
I have in my GUI 5 radiobuttons and pushbutton. The user selects the radiobutton (for example radiobutton1). And then press pushbutton, which should perform the function of radiobutton(radiobutton1).
This is my code:
function pushbutton1_Callback(hObject, eventdata, handles)
if radiobutton1 executes
load ('net.mat')
load ('trenovaci_modely1_velky')
disp('Neuronová síť byla načtena.')
disp('Trénovací modely byly načteny.')
disp('Trénovací modely byly načteny.')
P = [velky_tvar{1,:}];
T = [velky_tvar{2,:}];
net = newrb(P,T,0,0.3)
save net net
disp('Neuronová síť byla uložena.')
Comand Window returns errors. Please, advise me.

Sign in to comment.

Accepted Answer

Giorgos Papakonstantinou
Giorgos Papakonstantinou on 9 Mar 2015
If we assume the radiobutton handle variable name is radio then your if statement inside the pushbutton1_Callback should be:
if get(radio, 'Value')==1
And with else you mean every other possible situation.

Sign in to comment.

More Answers (0)


Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!