?? hgui1.m
字號:
function varargout = hugui1(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 08-Nov-2003 10:47:27
% 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', []);
if nargin<=1
fig1=openfig('hgui1.fig','reuse');
handles1=guihandles(fig1);
guidata(fig1,handles1);
if nargin>0
varargout{1}=fig1;
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, handles1, varargin)
% Choose default command line output for qushi
handles1.output = hObject;
% Update handles structure
guidata(hObject, handles1);
% --- Outputs from this function are returned to the command line.
function varargout = qushi_OutputFcn(hObject, eventdata, handles1)
varargout{1} = handles1.output;
% --- Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)function data_box_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction data_box_Callback(hObject, eventdata, handles)
% --- Executes on button press in import_button.function import_button_Callback(hObject, eventdata, handles1)[fname, pname] = uigetfile('*.mat', '打開數據文件');
global data
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(handles1.import_button,'enable','off');
set(handles1.run_button,'enable','on');
set(handles1.data_box,'string',num2str(data));
end % --- Executes on button press in run_button.function run_button_Callback(hObject, eventdata, handles1)% 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
panduan1=str2num(get(handles1.data_box,'string'));
if isempty(panduan1)
errordlg('您打開的數據文件有誤,可能為空,可能數據矩陣有不合法的字符或輸入!詳情請參閱“幫助”');
else
[n,m]=size(data);
x=data(:,1:m-1);
y=data(:,m);
m=m-1;
[B,U,Q,R,F,SS]=dd1(x,y,m,n);
set(handles1.outputdata_listbox,'string',{'回歸方程的系數為:',num2str(B),'回歸平方和為:',num2str(U),...
'剩余平方和為:',num2str(Q),'復相關系數為:',num2str(R),'F檢驗植為:',num2str(F),'剩余標準差為:',num2str(SS)})
end
% --- Executes during object creation, after setting all properties.function readresult_button_box_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on selection change in readresult_button_box.function readresult_button_box_Callback(hObject, eventdata, handles)
% --- Executes on button press in restart_button.function restart_button_Callback(hObject, eventdata, handles1)set(handles1.data_box,'string','');
set(handles1.outputdata_listbox,'string','');
set(handles1.import_button,'enable','on');
set(handles1.run_button,'enable','off');% --- Executes on button press in exit_button.function exit_button_Callback(hObject, eventdata, handles)close% --- Executes during object creation, after setting all properties.function answer_edit_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction answer_edit_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function menu_Callback(hObject, eventdata, handles)% 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, handles1)openfig('hgui1_help.fig','reuse');
% --------------------------------------------------------------------function menu2_Callback(hObject, eventdata, handles, varargin)importdata_help; % --------------------------------------------------------------------function menu3_Callback(hObject, eventdata, handles, varargin)restart_help;% --- Executes on button press in exit_button.function pushbutton8_Callback(hObject, eventdata, handles)% --- Executes on button press in readresult_button.function readresult_button_Callback(hObject, eventdata, handles1, varargin)readresult_pushbutton(handles1);% --- Executes on button press in save_button.function save_button_Callback(hObject, eventdata, handles1, varargin)save_pushbutton(handles1);% --------------------------------------------------------------------function menu4_Callback(hObject, eventdata, handles, varargin)readresult_help;% --------------------------------------------------------------------function menu5_Callback(hObject, eventdata, handles, varargin)save_help;% --- Executes during object creation, after setting all properties.function outputdata_listbox_CreateFcn(hObject, eventdata, handles)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, handles)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -