MATLAB仿XP系统计算器编程代码和GUI附图

上传人:我*** 文档编号:136342352 上传时间:2020-06-27 格式:DOC 页数:24 大小:151.50KB
返回 下载 相关 举报
MATLAB仿XP系统计算器编程代码和GUI附图_第1页
第1页 / 共24页
MATLAB仿XP系统计算器编程代码和GUI附图_第2页
第2页 / 共24页
MATLAB仿XP系统计算器编程代码和GUI附图_第3页
第3页 / 共24页
MATLAB仿XP系统计算器编程代码和GUI附图_第4页
第4页 / 共24页
MATLAB仿XP系统计算器编程代码和GUI附图_第5页
第5页 / 共24页
点击查看更多>>
资源描述

《MATLAB仿XP系统计算器编程代码和GUI附图》由会员分享,可在线阅读,更多相关《MATLAB仿XP系统计算器编程代码和GUI附图(24页珍藏版)》请在金锄头文库上搜索。

1、MATLAB仿XP系统计算器编程代码和GUI附图function varargout = Caculater(varargin)% CACULATER M-file for Caculater.fig% CACULATER, by itself, creates a new CACULATER or raises the existing% singleton*.% H = CACULATER returns the handle to a new CACULATER or the handle to% the existing singleton*.% CACULATER(CALLBACK,

2、hObject,eventData,handles,.) calls the local% function named CALLBACK in CACULATER.M with the given input arguments.% CACULATER(Property,Value,.) creates a new CACULATER or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before Caculater_OpeningF

3、unction gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to Caculater_OpeningFcn via varargin.% *See GUI Options on GUIDEs Tools menu. Choose GUI allows only one% instance to run (singleton).% See also: GUIDE, GUIDATA, GUIHANDLES %

4、Edit the above text to modify the response to help Caculater % Last Modified by GUIDE v2.5 19-Jul-2011 13:59:25 % Begin initialization code - DO NOT EDIT %程序有由于使用num2str函数,是的小数最多为四位,如需更多,可参考num2str(X,N),其中N表示最大容许小数位数 gui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Sing

5、leton, . gui_OpeningFcn, Caculater_OpeningFcn, . gui_OutputFcn, Caculater_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);end if nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varar

6、gin:);end% End initialization code - DO NOT EDIT % - Executes just before Caculater is made visible.function Caculater_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version

7、 of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to Caculater (see VARARGIN) % Choose default command line output for Caculaterhandles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes Caculater wait for user

8、response (see UIRESUME)% uiwait(handles.fig_caculater); set(handles.edit_show,String,0,UserData,0);set(handles.pushbutton_n0,UserData,0);set(handles.pushbutton_n1,UserData,0);set(handles.pushbutton_n2,UserData,0);set(handles.pushbutton_n3,UserData,0);set(handles.pushbutton_plus,UserData,0);set(handl

9、es.pushbutton_M,UserData,0);set(handles.pushbutton_MM,Enable,off,String,UserData,0);set(handles.pushbutton_point,UserData,0);set(handles.pushbutton_negate,UserData,0);set(handles.pushbutton_sqrt,UserData,0); % - Outputs from this function are returned to the command line.function varargout = Caculat

10、er_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Get default command line output from h

11、andles structurevarargout1 = handles.output; % - Executes on button press in pushbutton_MC.function pushbutton_MC_Callback(hObject, eventdata, handles)% hObject handle to pushbutton_MC (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and us

12、er data (see GUIDATA) num=get(handles.pushbutton_MM,UserData,0); if(rem(num,2)=1) set(handles.pushbutton_M,UserData,0); if (get(handles.pushbutton_n2,UserData)=0)&(get(handles.pushbutton_n3,UserData)=0) set(handles.pushbutton_n0,UserData,0); elseif (get(handles.pushbutton_n2,UserData)=1)&(get(handle

13、s.pushbutton_n3,UserData)=0) set(handles.pushbutton_n1,UserData,0); end set(handles.edit_show,String,0,UserData,0);end set(handles.pushbutton_point,UserData,0);set(handles.pushbutton_negate,UserData,0);set(handles.pushbutton_sqrt,UserData,0); % - Executes on button press in pushbutton_MR.function pu

14、shbutton_MR_Callback(hObject, eventdata, handles)% hObject handle to pushbutton_MR (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) num=get(handles.pushbutton_MM,UserData); if(rem(num,2)=1) num1=get(handles.pushbutton_M,UserData); set(handles.edit_show,String,num2str(num1),UserData,num1); if (get(handles.pushbutton_n2,UserData)=0)&(get(

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 事务文书

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号