?? fcfx1.m
字號:
function varargout = fcfx1(varargin)
% FCFX1 M-file for fcfx1.fig
% FCFX1, by itself, creates a new FCFX1 or raises the existing
% singleton*.
%
% H = FCFX1 returns the handle to a new FCFX1 or the handle to
% the existing singleton*.
%
% FCFX1('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in FCFX1.M with the given input arguments.
%
% FCFX1('Property','Value',...) creates a new FCFX1 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before fcfx1_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to fcfx1_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 fcfx1
% Last Modified by GUIDE v2.5 08-Nov-2003 13:30:32
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @fcfx1_OpeningFcn, ...
'gui_OutputFcn', @fcfx1_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
% End initialization code - DO NOT EDIT
if nargin<=1
fig1=openfig('fcfx1.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 fcfx1 is made visible.
function fcfx1_OpeningFcn(hObject, eventdata, handles1, 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 fcfx1 (see VARARGIN)
% Choose default command line output for fcfx1
handles1.output = hObject;
% Update handles structure
guidata(hObject, handles1);
% UIWAIT makes fcfx1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = fcfx1_OutputFcn(hObject, eventdata, handles1)
% 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} = handles1.output;
% --------------------------------------------------------------------function uimenu1_Callback(hObject, eventdata, handles1)% hObject handle to uimenu1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function um1_item1_Callback(hObject, eventdata, handles1)% hObject handle to um1_item1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)str='在一項(xiàng)試驗(yàn)中只有一個因素對試驗(yàn)結(jié)果有影響,就叫做單因素方差分析';msgbox(str)% --------------------------------------------------------------------function um1_item2_Callback(hObject, eventdata, handles1)% hObject handle to um1_item2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)str='原始數(shù)據(jù)為m×n的矩陣,其中列數(shù)n代表因素的水平數(shù),行數(shù)m代表每一因素的樣本個數(shù),請參閱示例數(shù)據(jù)文件fcdata1';
msgbox(str)
% --- Executes during object creation, after setting all properties.function data_box_CreateFcn(hObject, eventdata, handles1)% 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, handles1)% 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, handles1,varargin)% 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', '打開數(shù)據(jù)文件');
%如果打開文件對話框的"cancel"按鈕被選擇
if isequal([fname, pname], [0, 0])
return
%否則,轉(zhuǎn)載文件全名,包括路徑,并檢驗(yàn)文件,轉(zhuǎn)載它。
else
global data
File = fullfile(pname, fname);
%如果MAT文件有效的,存儲文件名
% if Check_And_Load(File, handls)
% handles.LastFile = File;
% guidata(fig1, handles)
if isempty(File)
errordlg('您打開的不是一個有效的數(shù)據(jù)文件');
end
if exist(File)==2
data=importdata(File);
end
set(handles1.data_box,'string',num2str(data));
set(handles1.import_button,'enable','off');
set(handles1.run_button,'enable','on');
end
% --- Executes on button press in run_button.function run_button_Callback(hObject, eventdata, handles1,varargin)% 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)% --- Executes on button press in restart_button.
global data
panduan1=str2num(get(handles1.data_box,'string'));
if isempty(panduan1)
errordlg('您打開的數(shù)據(jù)文件有誤,可能為空,可能數(shù)據(jù)矩陣有不合法的字符或輸入!詳情請參閱“幫助”');
else
p=anova1(data);
str_p=num2str(p);
set(handles1.outputdata_listbox,'string',str_p)
endfunction restart_button_Callback(hObject, eventdata, handles1)% 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(handles1.data_box,'string','');
set(handles1.outputdata_listbox,'string','');
set(handles1.import_button,'enable','on');
set(handles1.run_button,'enable','off');
% --- Executes during object creation, after setting all properties.function outputdata_listbox_CreateFcn(hObject, eventdata, handles1)% 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, handles1)% 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% --------------------------------------------------------------------function um1_item3_Callback(hObject, eventdata, handles)% hObject handle to um1_item3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)openfig('fcfx1_help.fig','reuse');% --- Executes on button press in exit_button.function exit_button_Callback(hObject, eventdata, handles)% 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 on button press in ok_button.
% --- Executes on button press in readresult_button.function readresult_button_Callback(hObject, eventdata, handles1, varargin)% hObject handle to readresult_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)readresult_pushbutton(handles1);% --- Executes on button press in save_button.function save_button_Callback(hObject, eventdata, handles1, varargin)% hObject handle to save_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)save_pushbutton(handles1);% --------------------------------------------------------------------function um1_item4_Callback(hObject, eventdata, handles, varargin)% hObject handle to um1_item4 (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 um1_item5_Callback(hObject, eventdata, handles, varargin)% hObject handle to um1_item5 (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 um1_item6_Callback(hObject, eventdata, handles, varargin)% hObject handle to um1_item6 (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 um1_item7_Callback(hObject, eventdata, handles, varargin)% hObject handle to um1_item7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)save_help;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -