MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB GUI] GUI中计算器的程序编写 (https://www.labfans.com/bbs/showthread.php?t=8842)

huo951 2009-06-06 09:42

GUI中计算器的程序编写
 
我打入的数字怎么在显示框里显示不了呢,显示框是用什么工具拉出来的呢?要怎么定义呢?希望高手解答一下,谢谢啊!:):):)
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if handles.flag
handles.s_Exp(handles.i)=')';
handles.flag=0;
handles.i=handles.i+1;
end
handles.s_Exp(handles.i)='-';
handles.j=1;
handles.s_Num='-';
handles.i=handles.i+1;
guidata(handles.mainWnd,handles);
set(handles.pExp,'string',handles.s_Num)
运行的时候,说没定义mainWnd和pExp,怎么定义呢

anbcjys 2009-06-06 18:42

回复: GUI中计算器的程序编写
 
[QUOTE=huo951;29119]我打入的数字怎么在显示框里显示不了呢,显示框是用什么工具拉出来的呢?要怎么定义呢?希望高手解答一下,谢谢啊!:):):)
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if handles.flag
handles.s_Exp(handles.i)=')';
handles.flag=0;
handles.i=handles.i+1;
end
handles.s_Exp(handles.i)='-';
handles.j=1;
handles.s_Num='-';
handles.i=handles.i+1;
guidata(handles.mainWnd,handles);
set(handles.pExp,'string',handles.s_Num)
运行的时候,说没定义mainWnd和pExp,怎么定义呢[/QUOTE]
edit text 等都可以显示

huo951 2009-06-07 14:40

回复: GUI中计算器的程序编写
 
用可视化GUI编写的,直接拉过来,然后定义了计算器的各个符号,貌似没有定义edit,text,输入数据的时候窗口不显示,请问怎么定义呢??:)


所有时间均为北京时间。现在的时间是 05:32

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.