⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guical.m

📁 这学期开了软件工程工具及其应用这么课
💻 M
📖 第 1 页 / 共 2 页
字号:
function varargout = guical(varargin)
% GUICAL M-file for guical.fig
%      GUICAL, by itself, creates a new GUICAL or raises the existing
%      singleton*.
%
%      H = GUICAL returns the handle to a new GUICAL or the handle to
%      the existing singleton*.
%
%      GUICAL('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in GUICAL.M with the given input arguments.
%
%      GUICAL('Property','Value',...) creates a new GUICAL or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before guical_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to guical_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 guical

% Last Modified by GUIDE v2.5 13-Aug-2006 20:05:08

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @guical_OpeningFcn, ...
                   'gui_OutputFcn',  @guical_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(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 guical is made visible.
function guical_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 guical (see VARARGIN)

% Choose default command line output for guical
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes guical wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = guical_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 on button press in num7.
function num7_Callback(hObject, eventdata, handles)
u=get(findobj(gcf,'tag','result'),'string');
v=strcat(u,int2str(7));
set(handles.result,'String',v);
% hObject    handle to num7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in num8.
function num8_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'8');
set(handles.result,'String',v);
% hObject    handle to num8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in num9.
function num9_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'9');
set(handles.result,'String',v);
% hObject    handle to num9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in num4.
function num4_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'4');
set(handles.result,'String',v);
% hObject    handle to num4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in num5.
function num5_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'5');
set(handles.result,'String',v);
% hObject    handle to num5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in num6.
function num6_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'6');
set(handles.result,'String',v);
% hObject    handle to num6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in num1.
function num1_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'1');
set(handles.result,'String',v);
% hObject    handle to num1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in num2.
function num2_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'2');
set(handles.result,'String',v);
% hObject    handle to num2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in num3.
function num3_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'3');
set(handles.result,'String',v);
% hObject    handle to num3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in num0.
function num0_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'0');
set(handles.result,'String',v);
% hObject    handle to num0 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in prefix.
function prefix_Callback(hObject, eventdata, handles)
v1=get(handles.result,'string');
if strncmp(v1,'-',1)==1
    v=strrep(v1,'-','');
else
    v=strcat('-',v1);
end
set(handles.result,'string',v);
% hObject    handle to prefix (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in dot.
function dot_Callback(hObject, eventdata, handles)
v1=get(findobj(gcf,'tag','result'),'string');
v=strcat(v1,'.');
set(handles.result,'string',v);
% hObject    handle to dot (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in divi.
function divi_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'/');
set(handles.result,'String',v);
% hObject    handle to divi (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in multi.
function multi_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'*');
set(handles.result,'String',v);
% hObject    handle to multi (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in minus.
function minus_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'-');
set(handles.result,'String',v);
% hObject    handle to minus (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in plus.
function plus_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
v=strcat(u,'+');
set(handles.result,'String',v);
% hObject    handle to plus (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in sqrt.
function sqrt_Callback(hObject, eventdata, handles)
v1=get(handles.result,'String');
v=sqrt(eval(get(handles.result,'String')));
set(handles.result,'String',v);
v2=num2str(v);
v3=strcat(v1,'(','sqrt',')','=',v2);
set(handles.progress,'string',v3)
% hObject    handle to sqrt (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in percent.
function percent_Callback(hObject, eventdata, handles)
v1=get(handles.result,'String');
v=(eval(v1))/100.00;
set(handles.result,'String',v);
v=num2str(v);
v2=strcat(v1,'%','=',v);
set(handles.progress,'string',v2);
% hObject    handle to percent (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton19.
function 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)


% --- Executes on button press in equal.
function equal_Callback(hObject, eventdata, handles)
v1=get(handles.result,'String');
v2=eval(v1);v=num2str(v2);
v=strcat(v1,'=',v);
set(handles.result,'String',v2);
set(handles.progress,'string',v);
% hObject    handle to equal (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton21.
function 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)


% --- Executes on button press in pushbutton22.
function pushbutton22_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton22 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton23.
function pushbutton23_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton23 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in mplus.
function mplus_Callback(hObject, eventdata, handles)
% hObject    handle to mplus (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in c.
function c_Callback(hObject, eventdata, handles)
% v1=get(handles.result,'string');
% v2=get(handles.progress,'string');
set(handles.result,'string','');
% set(handles.progress,'string','');
% hObject    handle to c (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in backspace.
function backspace_Callback(hObject, eventdata, handles)
u=get(handles.result,'string');
if isempty(u);
    ;
else u(end)=[];
    v=u;set(handles.result,'String',v);
end;
% hObject    handle to backspace (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton27.
function pushbutton27_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton27 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton28.
function pushbutton28_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton28 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton29.
function pushbutton29_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton29 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton30.
function pushbutton30_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton30 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

 

function clock_Callback(hObject, eventdata, handles)
% k=1;
% while k==1;
% a=datestr(now);
% set(gcbo,'string',a);
% pause(1);
% end
% hObject    handle to clock (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 clock as text
%        str2double(get(hObject,'String')) returns contents of clock as a double

% --- Executes during object creation, after setting all properties.

function clock_CreateFcn(hObject, eventdata, handles)
% k=1;
% while k==1;
% a=datestr(now);
% set(findobj(gcf,'tag','clock'),'string',a);
% pause(1);
% end
% hObject    handle to clock (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

 

function edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (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 edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -