|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
那个switch的 代码该怎么样写?
图中该设置什么?
多谢大家了
% --- Executes on selection change in sel.
function sel_Callback(hObject, eventdata, handles)
% hObject    handle to sel (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns sel contents as cell array
%        contents{get(hObject,'Value')} returns selected item from sel
switch sel_data
    case 1
        haha=str2num(get(handles.input,'string'))
    case 2
        hehe=str2num(get(handles.input,'string'))
    case 3
        huhu=str2num(get(handles.input,'string'))
    otherwise
        hoho=str2num(get(handles.input,'string'))
end
% --- Executes during object creation, after setting all properties.
function sel_CreateFcn(hObject, eventdata, handles)
% hObject    handle to sel (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
[ 本帖最后由 HolySaint 于 2007-7-24 19:29 编辑 ] |
-
|