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

📄 enter.m

📁 matlab book matlab book2
💻 M
字号:
function varargout = enter(varargin)
% ENTER M-file for enter.fig
% opens menu for entering username in order to access system

global NAME; % pass username between functions

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @enter_OpeningFcn, ...
                   'gui_OutputFcn',  @enter_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 enter is made visible.
function enter_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 enter (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = enter_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;



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

NAME = get(hObject,'String');

% --- Executes during object creation, after setting all properties.
function enter_editname_CreateFcn(hObject, eventdata, handles)
% hObject    handle to enter_editname (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


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

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

if (NAME == 0) | (userck(NAME) == 0)
    tryagain; % I/O error
    uiwait(tryagain);

elseif(userck(NAME) == 1)
    close;
    enterpw; % if name found then proceed to next module

elseif(userck(NAME) == 2)
    enterunf; % if name not found, display error box
end;



% --------------------------------------------------------------------
function enter_help_Callback(hObject, eventdata, handles)
% hObject    handle to enter_help (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% --------------------------------------------------------------------
function enter_instr_Callback(hObject, eventdata, handles)
% hObject    handle to enter_instr (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
enterinstr;
uiwait(enterinstr);

⌨️ 快捷键说明

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