`
deepfuture
  • 浏览: 4333069 次
  • 性别: Icon_minigender_1
  • 来自: 湛江
博客专栏
073ec2a9-85b7-3ebf-a3bb-c6361e6c6f64
SQLite源码剖析
浏览量:79419
1591c4b8-62f1-3d3e-9551-25c77465da96
WIN32汇编语言学习应用...
浏览量:68371
F5390db6-59dd-338f-ba18-4e93943ff06a
神奇的perl
浏览量:101493
Dac44363-8a80-3836-99aa-f7b7780fa6e2
lucene等搜索引擎解析...
浏览量:281173
Ec49a563-4109-3c69-9c83-8f6d068ba113
深入lucene3.5源码...
浏览量:14603
9b99bfc2-19c2-3346-9100-7f8879c731ce
VB.NET并行与分布式编...
浏览量:65559
B1db2af3-06b3-35bb-ac08-59ff2d1324b4
silverlight 5...
浏览量:31316
4a56b548-ab3d-35af-a984-e0781d142c23
算法下午茶系列
浏览量:45205
社区版块
存档分类
最新评论

matlab-模态对话框

 
阅读更多



 modal dialog box with the command:
user_response = modaldlg('Title','Confirm Close');


This is an example of calling a GUI with a property value pair. In this case, the figure property is 'Title', and its value is the string 'Confirm Close'.  

 

% --- Executes on button press in btn_draw.
function btn_draw_Callback(hObject, eventdata, handles)
% hObject    handle to btn_draw (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
%求解一元二次方程
myres=roots([getappdata(hObject,'numa'),getappdata(hObject,'numb'),getappdata(hObject,'numc')]);
set(handles.result,'string',mat2str(myres)) ;

%显示对话框,mymodaldlg是通过GUIDE的向导增加的模态提问问答对话框
mychoice=mymodaldlg('comput','value inspector')
switch mychoice
    case 'No'
        %显示一个对话框,不可能吧
    case 'Yes'
        delete(handles.figure1)
end

 



 

 

改生成的模态对话框


试运行



 
 增加显示不可能的对话框



 修改这个对话框



 最终代码

 

% --- Executes on button press in btn_draw.
function btn_draw_Callback(hObject, eventdata, handles)
% hObject    handle to btn_draw (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
%求解一元二次方程
myres=roots([getappdata(hObject,'numa'),getappdata(hObject,'numb'),getappdata(hObject,'numc')]);
set(handles.result,'string',mat2str(myres)) ;

%显示对话框,mymodaldlg是通过GUIDE的向导增加的模态提问问答对话框
mychoice=mymodaldlg('comput','value inspector')
switch mychoice
    case 'No'
        %显示一个对话框,不可能吧
        mych=npmodaldlg('computvalue','value yes')
    case 'Yes'
        delete(handles.figure1)
end

 

 

  • 大小: 41.1 KB
  • 大小: 37.2 KB
  • 大小: 27.9 KB
  • 大小: 43.6 KB
  • 大小: 39 KB
  • 大小: 27.8 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics