?? jisuanqi.m
字號:
function varargout = jisuanqi(varargin)
% JISUANQI M-file for jisuanqi.fig
% JISUANQI, by itself, creates a new JISUANQI or raises the existing
% singleton*.
%
% H = JISUANQI returns the handle to a new JISUANQI or the handle to
% the existing singleton*.
%
% JISUANQI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in JISUANQI.M with the given input arguments.
%
% JISUANQI('Property','Value',...) creates a new JISUANQI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before jisuanqi_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to jisuanqi_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help jisuanqi
% Last Modified by GUIDE v2.5 20-Nov-2007 19:41:39
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @jisuanqi_OpeningFcn, ...
'gui_OutputFcn', @jisuanqi_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin & isstr(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before jisuanqi is made visible.
function jisuanqi_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 of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to jisuanqi (see VARARGIN)
% Choose default command line output for jisuanqi
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes jisuanqi wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = jisuanqi_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 handles structure
varargout{1} = handles.output;
%定義calculate函數(shù),用于兩個數(shù)的計算
function answer=calculate(Number1,Number2,opvalue)
switch (opvalue)
case '+'
answer=Number1+Number2;%加法
case '-'
answer=Number1-Number2;%減法
case '*'
answer=Number1*Number2;%乘法
case '/'
answer=Number1/Number2;%除法
case '^'
answer=Number1^Number2;%求冪次
case 'log'
answer=log(Number1)/log(Number2); %取對數(shù)
otherwise
end
% --- Executes on button press in pushbutton1.
%按鍵startfunction pushbutton1_Callback(hObject, eventdata, handles)% hObject handle to pushbutton1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global Number1;% --- 操作數(shù)1
global Number2;% --- 操作數(shù)2
global opvalue;% --- 運算符
global IsStart;% --- 開啟鍵
global IsNew;% --- 操作數(shù)新得開始
Number1='';
Number2='';
opvalue = '';
IsNew='true';
IsStart='true';
set(handles.text2,'string','0');
% --- Executes on button press in pushbutton4.
%按鍵9function 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)
global IsNew;
global IsStart;
if strcmp(IsStart,'true')==1
if strcmp(IsNew,'true')==1
set(handles.text2,'String','9');
IsNew='false',;
else
num=strcat(get(handles.text2,'String'),'9');
set(handles.text2,'String',num);
end
end
% --- Executes on button press in pushbutton13.
%按鍵8function pushbutton13_Callback(hObject, eventdata, handles)% hObject handle to pushbutton13 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global IsNew;
global IsStart;
if strcmp(IsStart,'true')==1
if strcmp(IsNew,'true')==1
set(handles.text2,'String','8');
IsNew='false',;
else
num=strcat(get(handles.text2,'String'),'8');
set(handles.text2,'String',num);
end
end
% --- Executes on button press in pushbutton14.
%按鍵6function pushbutton14_Callback(hObject, eventdata, handles)% hObject handle to pushbutton14 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global IsNew;
global IsStart;
if strcmp(IsStart,'true')==1
if strcmp(IsNew,'true')==1
set(handles.text2,'String','6');
IsNew='false',;
else
num=strcat(get(handles.text2,'String'),'6');
set(handles.text2,'String',num);
end
end% --- Executes on button press in pushbutton15.
%按鍵5function pushbutton15_Callback(hObject, eventdata, handles)% hObject handle to pushbutton15 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global IsNew;
global IsStart;
if strcmp(IsStart,'true')==1
if strcmp(IsNew,'true')==1
set(handles.text2,'String','5');
IsNew='false',;
else
num=strcat(get(handles.text2,'String'),'5');
set(handles.text2,'String',num);
end
end% --- Executes on button press in pushbutton16.
%按鍵7function pushbutton16_Callback(hObject, eventdata, handles)% hObject handle to pushbutton16 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global IsNew;
global IsStart;
if strcmp(IsStart,'true')==1
if strcmp(IsNew,'true')==1
set(handles.text2,'String','7');
IsNew='false',;
else
num=strcat(get(handles.text2,'String'),'7');
set(handles.text2,'String',num);
end
end% --- Executes on button press in pushbutton17.
%按鍵4function pushbutton17_Callback(hObject, eventdata, handles)% hObject handle to pushbutton17 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global IsNew;
global IsStart;
if strcmp(IsStart,'true')==1
if strcmp(IsNew,'true')==1
set(handles.text2,'String','4');
IsNew='false',;
else
num=strcat(get(handles.text2,'String'),'4');
set(handles.text2,'String',num);
end
end% --- Executes on button press in pushbutton18.
%按鍵3function pushbutton18_Callback(hObject, eventdata, handles)% hObject handle to pushbutton18 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global IsNew;
global IsStart;
if strcmp(IsStart,'true')==1
if strcmp(IsNew,'true')==1
set(handles.text2,'String','3');
IsNew='false',;
else
num=strcat(get(handles.text2,'String'),'3');
set(handles.text2,'String',num);
end
end% --- Executes on button press in pushbutton19.
%按鍵2function pushbutton19_Callback(hObject, eventdata, handles)% hObject handle to pushbutton19 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global IsNew;
global IsStart;
if strcmp(IsStart,'true')==1
if strcmp(IsNew,'true')==1
set(handles.text2,'String','2');
IsNew='false',;
else
num=strcat(get(handles.text2,'String'),'2');
set(handles.text2,'String',num);
end
end% --- Executes on button press in pushbutton20.
%按鍵1function pushbutton20_Callback(hObject, eventdata, handles)% hObject handle to pushbutton20 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global IsNew;
global IsStart;
if strcmp(IsStart,'true')==1
if strcmp(IsNew,'true')==1
set(handles.text2,'String','1');
IsNew='false',;
else
num=strcat(get(handles.text2,'String'),'1');
set(handles.text2,'String',num);
end
end% --- Executes on button press in pushbutton21.
%按鍵0function pushbutton21_Callback(hObject, eventdata, handles)% hObject handle to pushbutton21 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global IsNew;
global IsStart;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -