First of all, you don't need anything in the callback for the radio buttons or uipanel unless you want to do something, like change a static text label or load a popup list or something like that. You don't need it to just set a and b like you did, since you can get those in the pushbutton callback just by calling get(). So clear out your uipanel1_SelectionChangeFcn() callback and then have just this as the pushbutton callback:
function pushbutton1_Callback(hObject, eventdata, handles)
a = get(handles.radiobutton1,'value');
b = get(handles.radiobutton2,'value');
if a == 1
uiwait(msgbox ('first button'));
end
if b == 1
uiwait(msgbox('second button'));
end
end
Best Answer