📄 jsq1.m
字号:
function jsq1(varargin)% JSQ1 M-file for jsq1.fig% JSQ1, by itself, creates a new JSQ1 or raises the existing% singleton*.%% H = JSQ1 returns the handle to a new JSQ1 or the handle to% the existing singleton*.%% JSQ1('Property','Value',...) creates a new JSQ1 using the% given property value pairs. Unrecognized properties are passed via% varargin to jsq1_OpeningFcn. This calling syntax produces a% warning when there is an existing singleton*.%% JSQ1('CALLBACK') and JSQ1('CALLBACK',hObject,...) call the% local function named CALLBACK in JSQ1.M with the given input% arguments.%% *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 jsq1% Last Modified by GUIDE v2.5 04-Sep-2004 22:57:35% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @jsq1_OpeningFcn, ... 'gui_OutputFcn', @jsq1_OutputFcn, ... 'gui_LayoutFcn', [], ... 'gui_Callback', []);if nargin & isstr(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});endif 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 jsq1 is made visible.function jsq1_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 unrecognized PropertyName/PropertyValue pairs from the% command line (see VARARGIN)% Choose default command line output for jsq1handles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes jsq1 wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = jsq1_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 structurevarargout{1} = handles.output;% --- Executes during object creation, after setting all properties.function edit1_CreateFcn(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','[1,50,12]');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit1_Callback(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit1 as text% str2double(get(hObject,'String')) returns contents of edit1 as a double% --- Executes on button press in pushbutton7.function pushbutton7_Callback(hObject, eventdata, handles)% hObject handle to pushbutton7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global aa;aa=get(handles.edit1,'String');if aa=='0' aa='7'else aa=[aa,'7'] endset(handles.edit1,'String',aa);% --- Executes on button press in pushbutton8.function pushbutton8_Callback(hObject, eventdata, handles)% hObject handle to pushbutton8 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global aa;aa=get(handles.edit1,'String');if aa=='0' aa='8'else aa=[aa,'8'] endset(handles.edit1,'String',aa);% --- Executes on button press in pushbutton9.function pushbutton9_Callback(hObject, eventdata, handles)% hObject handle to pushbutton9 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global aa;aa=get(handles.edit1,'String');if aa=='0' aa='9'else aa=[aa,'9'] endset(handles.edit1,'String',aa);% --- 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)global aa;aa=get(handles.edit1,'String');if aa=='0' aa='4'else aa=[aa,'4'] endset(handles.edit1,'String',aa);% --- Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)% hObject handle to pushbutton5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global aa;aa=get(handles.edit1,'String');if aa=='0' aa='5'else aa=[aa,'5'] endset(handles.edit1,'String',aa);% --- Executes on button press in pushbutton6.function pushbutton6_Callback(hObject, eventdata, handles)% hObject handle to pushbutton6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global aa;aa=get(handles.edit1,'String');if aa=='0' aa='6'else aa=[aa,'6'] endset(handles.edit1,'String',aa);% --- Executes on button press in pushbutton1.function varargout=pushbutton1_Callback(hObject, eventdata, handles,varargin)% 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)aa=get(handles.edit1,'String');if aa=='0' aa='1'else aa=[aa,'1'] endset(handles.edit1,'String',aa);% --- Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global aa;aa=get(handles.edit1,'String');if aa=='0' aa='2'else aa=[aa,'2'] endset(handles.edit1,'String',aa);% --- Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject handle to pushbutton3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global aa;aa=get(handles.edit1,'String');if aa=='0' aa='3'else aa=[aa,'3'] endset(handles.edit1,'String',aa);% --- Executes on button press in pushbutton0.function pushbutton0_Callback(hObject, eventdata, handles)% hObject handle to pushbutton0 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global aa;aa=get(handles.edit1,'String');if aa=='0' aa='0'else aa=[aa,'0'] endset(handles.edit1,'String',aa);% --- Executes on button press in pushbuttonqing.function pushbuttonqing_Callback(hObject, eventdata, handles)% hObject handle to pushbuttonqing (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)set(handles.edit1,'String','0');global flag;global mid;global aa;flag=0;mid=0;aa='0';% --- Executes on button press in pushbuttondeng.function pushbuttondeng_Callback(hObject, eventdata, handles)% hObject handle to pushbuttondeng (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global flag;global mid;global aa;switch flag case {1} result=str2num(mid)+str2num(aa); case {2} result=str2num(mid)-str2num(aa); case {3} result=str2num(mid)*str2num(aa); case {4} result=str2num(mid)/str2num(aa); otherwise result=0;endnum2str(result);mid=num2str(result);set(handles.edit1,'String',result);% --- Executes on button press in pushbuttonjia.function pushbuttonjia_Callback(hObject, eventdata, handles)% hObject handle to pushbuttonjia (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global flag;flag=1;global mid;mid=get(handles.edit1,'String');set(handles.edit1,'String','0');% --- Executes on button press in pushbuttonjian.function pushbuttonjian_Callback(hObject, eventdata, handles)% hObject handle to pushbuttonjian (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global flag;flag=2;global mid;mid=get(handles.edit1,'String');set(handles.edit1,'String','0');% --- Executes on button press in pushbuttonchen.function pushbuttonchen_Callback(hObject, eventdata, handles)% hObject handle to pushbuttonchen (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global flag;flag=3;global mid;mid=get(handles.edit1,'String');set(handles.edit1,'String','0');% --- Executes on button press in pushbuttonchu.function pushbuttonchu_Callback(hObject, eventdata, handles)% hObject handle to pushbuttonchu (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global flag;flag=4;global mid;mid=get(handles.edit1,'String');set(handles.edit1,'String','0');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -