📄 caldytrol.m
字号:
function varargout = caldytrol(varargin)
% CALDYTROL M-file for caldytrol.fig
% CALDYTROL, by itself, creates a new CALDYTROL or raises the existing
% singleton*.
%
% H = CALDYTROL returns the handle to a new CALDYTROL or the handle to
% the existing singleton*.
%
% CALDYTROL('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CALDYTROL.M with the given input arguments.
%
% CALDYTROL('Property','Value',...) creates a new CALDYTROL or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before caldytrol_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to caldytrol_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 caldytrol
% Last Modified by GUIDE v2.5 10-May-2006 17:10:49
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @caldytrol_OpeningFcn, ...
'gui_OutputFcn', @caldytrol_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 caldytrol is made visible.
function caldytrol_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 caldytrol (see VARARGIN)
% Choose default command line output for caldytrol
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes caldytrol wait for user response (see UIRESUME)
% uiwait(handles.figure1);
set(gcf,'menubar',menubar);
% --- Outputs from this function are returned to the command line.
function varargout = caldytrol_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;
% --- Executes during object creation, after setting all properties.function screen_CreateFcn(hObject, eventdata, handles)% hObject handle to screen (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','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction screen_Callback(hObject, eventdata, handles)% hObject handle to screen (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 screen as text% str2double(get(hObject,'String')) returns contents of screen as a double% --- Executes on button press in button0.function button0_Callback(hObject, eventdata, handles)% hObject handle to button0 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)if(handles.add==1)
val=get(handles.screen,'String');
if(strcmp(val,' '))
val='0';
else
val=strcat(val,'0');
end
else
val='0';
handles.add=1;
handles.dot=0;
end
set(handles.screen,'String',val);
guidata(hObject,handles);% --- Executes on button press in button1.function button1_Callback(hObject, eventdata, handles)% hObject handle to button1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)if(handles.add==1)
val=get(handles.screen,'String');
if(strcmp(val,' '))
val='1';
elseif(strcmp(val,'0'))
val='1';
else
val=strcat(val,'1');
end
else
val='1'
handles.add=1;
handles.dot=0;
end
set(handles.screen,'String',val);
guidata(hObject,handles);
% --- Executes on button press in button2.
function button2_Callback(hObject, eventdata, handles)
% hObject handle to button2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if(handles.add==1)
val=get(handles.screen,'String');
if(strcmp(val,' '))
val='2';
elseif(strcmp(val,'0'))
val='2';
else
val=strcat(val,'2');
end
else
val='2'
handles.add=1;
handles.dot=0;
end
set(handles.screen,'String',val);
guidata(hObject,handles);
% --- Executes on button press in button3.function button3_Callback(hObject, eventdata, handles)% hObject handle to button3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)if(handles.add==1)
val=get(handles.screen,'String');
if(strcmp(val,' '))
val='3';
elseif(strcmp(val,'0'))
val='3';
else
val=strcat(val,'3');
end
else
val='3'
handles.add=1;
handles.dot=0;
end
set(handles.screen,'String',val);
guidata(hObject,handles);
% --- Executes on button press in button4.
function button4_Callback(hObject, eventdata, handles)
% hObject handle to button4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if(handles.add==1)
val=get(handles.screen,'String');
if(strcmp(val,' '))
val='4';
elseif(strcmp(val,'0'))
val='4';
else
val=strcat(val,'4');
end
else
val='4'
handles.add=1;
handles.dot=0;
end
set(handles.screen,'String',val);
guidata(hObject,handles);
% --- Executes on button press in button5.
function button5_Callback(hObject, eventdata, handles)
% hObject handle to button5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if(handles.add==1)
val=get(handles.screen,'String');
if(strcmp(val,' '))
val='5';
elseif(strcmp(val,'0'))
val='5';
else
val=strcat(val,'5');
end
else
val='5'
handles.add=1;
handles.dot=0;
end
set(handles.screen,'String',val);
guidata(hObject,handles);
% --- Executes on button press in button6.
function button6_Callback(hObject, eventdata, handles)
% hObject handle to button6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if(handles.add==1)
val=get(handles.screen,'String');
if(strcmp(val,' '))
val='6';
elseif(strcmp(val,'0'))
val='6';
else
val=strcat(val,'6');
end
else
val='6'
handles.add=1;
handles.dot=0;
end
set(handles.screen,'String',val);
guidata(hObject,handles);
% --- Executes on button press in button7.
function button7_Callback(hObject, eventdata, handles)
% hObject handle to button7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if(handles.add==1)
val=get(handles.screen,'String');
if(strcmp(val,' '))
val='7';
elseif(strcmp(val,'0'))
val='7';
else
val=strcat(val,'7');
end
else
val='7'
handles.add=1;
handles.dot=0;
end
set(handles.screen,'String',val);
guidata(hObject,handles);
% --- Executes on button press in button8.
function button8_Callback(hObject, eventdata, handles)
% hObject handle to button8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if(handles.add==1)
val=get(handles.screen,'String');
if(strcmp(val,' '))
val='8';
elseif(strcmp(val,'0'))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -