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

📄 clas3way.m

📁 多元曲线解析-交替最小二乘法,MCR-ALS
💻 M
📖 第 1 页 / 共 3 页
字号:
function varargout = clas3way(varargin)
% CLAS3WAY M-file for clas3way.fig

% Last Modified by GUIDE v2.5 21-Apr-2004 17:50:37

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

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = clas3way_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 during object creation, after setting all properties.
function popup_seldat_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popup_seldat (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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

llista(1)={'select...'};
llista(2)={'Column-wise augmented data matrix (C direction)'};
llista(3)={'Row-wise augmented data matrix (S direction)'};
llista(4)={'Column- and Row-wise augmented data matrix (C&S directions)'};
set(hObject,'string',llista)


% --- Executes on selection change in popup_seldat.
function popup_seldat_Callback(hObject, eventdata, handles)
% hObject    handle to popup_seldat (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 popup_seldat contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popup_seldat

datamod=get(handles.popup_seldat,'Value')-1;

if datamod==0
    set(handles.text_numC,'enable','off');
    set(handles.text_numS,'enable','off');
    set(handles.text_Csub,'enable','off');
    set(handles.text_selnc,'enable','off');
    set(handles.text_nr,'enable','off');
    set(handles.text_Ssub,'enable','off');
    set(handles.text_selns,'enable','off');
    set(handles.text_nc,'enable','off');
    set(handles.edit_nr,'enable','off'); 
    set(handles.edit_nc,'enable','off'); 
    set(handles.popup_numC,'enable','off','value',1);
    set(handles.popup_numS,'enable','off','value',1);
    set(handles.popup_selnc,'enable','off','value',1);
    set(handles.popup_selns,'enable','off','value',1);
    set(handles.push_ok,'enable','off');        
elseif datamod==1
    set(handles.text_numC,'enable','on');
    set(handles.text_numS,'enable','off');
    set(handles.text_Csub,'enable','off');
    set(handles.text_selnc,'enable','off');
    set(handles.text_nr,'enable','off');
    set(handles.text_Ssub,'enable','off');
    set(handles.text_selns,'enable','off');
    set(handles.text_nc,'enable','off');    
    set(handles.edit_nr,'enable','off'); 
    set(handles.edit_nc,'enable','off');     
    set(handles.popup_numC,'enable','on','value',1);
    set(handles.popup_numS,'enable','off','value',1);
    set(handles.popup_selnc,'enable','off','value',1);
    set(handles.popup_selns,'enable','off','value',1);    
    set(handles.push_ok,'enable','off');    
elseif datamod==2    
    set(handles.text_numS,'enable','on');
    set(handles.text_numC,'enable','off');
    set(handles.text_Csub,'enable','off');
    set(handles.text_selnc,'enable','off');
    set(handles.text_nr,'enable','off');
    set(handles.text_Ssub,'enable','off');
    set(handles.text_selns,'enable','off');
    set(handles.text_nc,'enable','off');    
    set(handles.edit_nr,'enable','off'); 
    set(handles.edit_nc,'enable','off');     
    set(handles.popup_numS,'enable','on','value',1);
    set(handles.popup_numC,'enable','off','value',1);
    set(handles.popup_selnc,'enable','off','value',1);
    set(handles.popup_selns,'enable','off','value',1);    
    set(handles.push_ok,'enable','off');    
elseif datamod==3    
    set(handles.text_numC,'enable','on');
    set(handles.text_numS,'enable','on');
    set(handles.text_Csub,'enable','off');
    set(handles.text_selnc,'enable','off');
    set(handles.text_nr,'enable','off');
    set(handles.text_Ssub,'enable','off');
    set(handles.text_selns,'enable','off');
    set(handles.text_nc,'enable','off');    
    set(handles.edit_nr,'enable','off'); 
    set(handles.edit_nc,'enable','off');     
    set(handles.popup_numC,'enable','on','value',1);
    set(handles.popup_numS,'enable','on','value',1);
    set(handles.popup_selnc,'enable','off','value',1);
    set(handles.popup_selns,'enable','off','value',1);    
    set(handles.push_ok,'enable','off');    
end

%inic. matc i matr
matc=0;matr=0;
assignin('base','matc',matc);
evalin('base','als_opt.multi.matc=matc;');
evalin('base','clear matc');
assignin('base','matr',matr);
evalin('base','als_opt.multi.matr=matr;');
evalin('base','clear matr');
assignin('base','datamod',datamod);
evalin('base','als_opt.multi.datamod=datamod;');
evalin('base','clear datamod');

% --- Executes during object creation, after setting all properties.
function popup_numC_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popup_numC (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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

nexp=evalin('base','als_opt.nexp');
j=2;
llistannc(1)={'select...'};
for i=1:1:nexp;
    llistnnc=[i];
    llistannc(j)={llistnnc};
    j=j+1;
end;
set(hObject,'string',llistannc)

% --- Executes on selection change in popup_numC.
function popup_numC_Callback(hObject, eventdata, handles)
% hObject    handle to popup_numC (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 popup_numC contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popup_numC

matc=get(handles.popup_numC,'Value')-1;

if evalin('base','als_opt.multi.datamod')==1    
    set(handles.text_Csub,'enable','on');
    set(handles.text_selnc,'enable','on');
    set(handles.text_nr,'enable','off');    
    set(handles.text_Ssub,'enable','off');
    set(handles.text_selns,'enable','off');
    set(handles.text_nc,'enable','off');    
    set(handles.edit_nr,'enable','off'); 
    set(handles.edit_nc,'enable','off');     
    set(handles.popup_numS,'enable','off','value',2);
    matr=get(handles.popup_numS,'Value')-1;
    assignin('base','matr',matr);
    evalin('base','als_opt.multi.matr=matr;');
    evalin('base','clear matr ');
    j=2;
    llistannc(1)={'select...'};    
    for i=1:1:matc;
        llistnnc=[i];
        llistannc(j)={llistnnc};
        j=j+1;
    end;    
    set(handles.popup_selnc,'string',llistannc,'enable','on','value',1);
    set(handles.popup_selns,'enable','off');
    set(handles.push_ok,'enable','off');
    
    if matc*matr ~= evalin('base','als_opt.nexp')
        errordlg('Warning: nr. of submatrices in C x nr. of submatrices in S should be equal to nexp')
        set(handles.text_Csub,'enable','off');
        set(handles.text_selnc,'enable','off');
        set(handles.text_nr,'enable','off');
        set(handles.edit_nr,'enable','off','string',' '); 
        set(handles.popup_selnc,'string',llistannc,'enable','off','value',1);
    end
    
else 
    
    max=evalin('base','als_opt.nexp');    
    if matc==1 |matc==max |matc==0
        errordlg('Re-define your data set class');
        set(handles.text_Ssub,'enable','off');
        set(handles.text_selns,'enable','off');
        set(handles.text_nc,'enable','off');
        set(handles.edit_nc,'enable','off','string',' '); 
        set(handles.popup_selns,'string','select...','enable','off','value',1);        
        set(handles.text_Csub,'enable','off');
        set(handles.text_selnc,'enable','off');
        set(handles.text_nr,'enable','off');
        set(handles.edit_nr,'enable','off','string',' '); 
        set(handles.popup_selnc,'string','select...','enable','off','value',1);        
    else        
        matr=get(handles.popup_numS,'Value')-1;
        assignin('base','matr',matr);
        evalin('base','als_opt.multi.matr=matr;');
        evalin('base','clear matr ');
        j=2; % list conc. matrices
        llistannc(1)={'select...'};
        for i=1:1:matc;
            llistnnc=[i];

⌨️ 快捷键说明

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