如何在GUI中获取radiobutton的状态并判断
1个回答
展开全部
function load_cycle_Callback(hObject, eventdata, handles)
if get(handles.radiobutton1,'value')
set(handles.edit1,'string','1') % Set the editbox string.
elseif get(handles.radiobutton2,'value')
set(handles.edit1,'string','2')
elseif get(handles.radiobutton3,'value')
set(handles.edit1,'string','3')
elseif get(handles.radiobutton4,'value')
set(handles.edit1,'string','4')
elseif get(handles.radiobutton5,'value')
set(handles.edit1,'string','5')
else
msgbox('none,please load new cycle!') % Very unlikely I think.
end
if get(handles.radiobutton1,'value')
set(handles.edit1,'string','1') % Set the editbox string.
elseif get(handles.radiobutton2,'value')
set(handles.edit1,'string','2')
elseif get(handles.radiobutton3,'value')
set(handles.edit1,'string','3')
elseif get(handles.radiobutton4,'value')
set(handles.edit1,'string','4')
elseif get(handles.radiobutton5,'value')
set(handles.edit1,'string','5')
else
msgbox('none,please load new cycle!') % Very unlikely I think.
end
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询