📄 hgui2.asv
字号:
function varargout = hgui2(varargin)
% QUSHI M-file for qushi.fig
% QUSHI, by itself, creates a new QUSHI or raises the existing
% singleton*.
%
% H = QUSHI returns the handle to a new QUSHI or the handle to
% the existing singleton*.
%
% QUSHI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in QUSHI.M with the given input arguments.
%
% QUSHI('Property','Value',...) creates a new QUSHI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before qushi_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to qushi_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 qushi
% Last Modified by GUIDE v2.5 07-Nov-2003 21:32:24
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @qushi_OpeningFcn, ...
'gui_OutputFcn', @qushi_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
% End initialization code - DO NOT EDIT
if nargin<=1
fig2=openfig('hgui2.fig','reuse');
handles2=guihandles(fig2);
guidata(fig2,handles2);
%if nargin==0
% check_and_load([],handles1);
% elseif exist(varargin{1},handles1)
%check_and_load(varargin)
if nargin>0
varargout{1}=fig2;
end
elseif ischar(varargin{1})
try
[varargout{1:nargout}]=feval(varargin{:});
catch
disp(lasterr);
end
end
% --- Executes just before qushi is made visible.
function qushi_OpeningFcn(hObject, eventdata, handles2, 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 qushi (see VARARGIN)
% Choose default command line output for qushi
handles2.output = hObject;
% Update handles structure
guidata(hObject, handles2);
% UIWAIT makes qushi wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = qushi_OutputFcn(hObject, eventdata, handles2)
% 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} = handles2.output;
% --- Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles2)% 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)% --- Executes during object creation, after setting all properties.function data_box_CreateFcn(hObject, eventdata, handles2)% hObject handle to data_box (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: listbox 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'));end% --- Executes on selection change in data_box.function data_box_Callback(hObject, eventdata, handles2)% hObject handle to data_box (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns data_box contents as cell array% contents{get(hObject,'Value')} returns selected item from data_box
% --- Executes on button press in import_button.function import_button_Callback(hObject, eventdata, handles2)% hObject handle to import_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)[fname, pname] = uigetfile('*.mat', '打开数据文件');
global data
%如果打开文件对话框的"cancel"按钮被选择
if isequal([fname, pname], [0, 0])
return
%否则,转载文件全名,包括路径,并检验文件,转载它。
else
File = fullfile(pname, fname);
if isempty(File)
errordlg('您打开的不是一个有效的数据文件');
end
if exist(File)==2
data=importdata(File);
end
set(handles2.import_button,'enable','off');
set(handles2.ok_button,'enable','on');
set(handles2.data_box,'string',num2str(data));
end
% --- Executes on button press in ok_button.function ok_button_Callback(hObject, eventdata, handles2)% hObject handle to ok_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global Fin Fout
input={'请输入引入变量的门坎值Fin:','请输入剔除变量的门坎值Fout:'};
reps=inputdlg(input);
Fin=str2num(reps{1});
Fout=str2num(reps{2});
if (isempty(Fin))|(isempty(Fout))
warndlg('你输入的值有误,可能为空,可能有不合法的字符或输入!')
else
set(handles2.run_button,'enable','on');
set(handles2.ok_button,'enable','off');
end
% --- Executes on button press in run_button.function run_button_Callback(hObject, eventdata, handles2)% hObject handle to run_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global data Fin Fout
panduan1=str2num(get(handles2.data_box,'string'));
if isempty(panduan1)
errordlg('您打开的数据文件有误,可能为空,可能数据矩阵有不合法的字符或输入!详情请参阅“帮助”');
else
x=data;
zbhg(x,Fin,Fout,handles2);
end
% --- Executes during object creation, after setting all properties.function outputdata_listbox_CreateFcn(hObject, eventdata, handles2)% hObject handle to outputdata_listbox (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: listbox 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'));end% --- Executes on selection change in outputdata_listbox.function outputdata_listbox_Callback(hObject, eventdata, handles2)% hObject handle to outputdata_listbox (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns outputdata_listbox contents as cell array% contents{get(hObject,'Value')} returns selected item from outputdata_listbox
% --- Executes on button press in restart_button.function restart_button_Callback(hObject, eventdata, handles2)% hObject handle to restart_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
set(handles2.data_box,'string','');
set(handles2.outputdata_listbox,'string','');
set(handles2.import_button,'enable','on');
set(handles2.ok_button,'enable','off');
set(handles2.run_button,'enable','off');
% --- Executes on button press in exit_button.function exit_button_Callback(hObject, eventdata, handles2)% hObject handle to exit_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)close% --- Executes during object creation, after setting all properties.% --------------------------------------------------------------------function menu_Callback(hObject, eventdata, handles2, varargin)% hObject handle to menu (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function menu1_Callback(hObject, eventdata, handles2, varargin)% hObject handle to menu1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)openfig('hgui2_help.fig','reuse');% --------------------------------------------------------------------function menu2_Callback(hObject, eventdata, handles2, varargin)% hObject handle to menu2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)importdata_help; % --------------------------------------------------------------------function menu3_Callback(h, eventdata, handles, varargin)% hObject handle to menu3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)restart_help;% --------------------------------------------------------------------function Untitled_5_Callback(hObject, eventdata, handles, varargin)% hObject handle to Untitled_5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
readresult_help;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%逐步回归源程序%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function zbhg(x,Fin,Fout,handles2)
%%%%%%%%%%%%%%%%%%%%%%%%%%
%预处理
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -