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

📄 als2004multi.m

📁 多元曲线解析-交替最小二乘法,MCR-ALS
💻 M
📖 第 1 页 / 共 5 页
字号:
evalin('base','als_opt.unimod.spsmod=[];');

assignin('base','imod',imod);
evalin('base','als_opt.unimod.imod=imod;');
evalin('base','clear imod');


% --- Executes during object creation, after setting all properties.
function popup_iuni_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popup_iuni (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)={'vertical'};
llista(3)={'horizontal'};
llista(4)={'average'};
set(hObject,'string',llista)

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

cmod=get(hObject,'Value')-2;
assignin('base','cmod',cmod);
evalin('base','als_opt.unimod.cmod=cmod;');
evalin('base','clear cmod');

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

dim=evalin('base','min(size(als_opt.iniesta))');
j=2;
llistannc(1)={'select...'};
for i=0:1:dim;
    llistnnc=[i];
    llistannc(j)={llistnnc};
    j=j+1;
end;

set(hObject,'string',llistannc)

% --- Executes on selection change in popup_ncuni.
function popup_ncuni_Callback(hObject, eventdata, handles)
% hObject    handle to popup_ncuni (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_ncuni contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popup_ncuni
% --- Executes during object creation, after setting all properties.


nmod=get(hObject,'Value')-2;

assignin('base','nmod',nmod);
evalin('base','als_opt.unimod.nmod=nmod;');
dim=evalin('base','min(size(als_opt.iniesta))');
matc=evalin('base','als_opt.multi.matc');
curr_cmat=evalin('base','als_opt.multi.curr_cmat');
curr_smat=evalin('base','als_opt.multi.curr_smat');
spmod=evalin('base','als_opt.unimod.spmod');

if evalin('base','als_opt.multi.ccons')==1

    if nmod == dim
        spmod=ones(matc,dim);
        set(handles.text_spunic,'enable','off');
        set(handles.edit_spunic,'enable','off','string','');
    elseif  nmod == 0
        spmod=zeros(matc,dim);
        set(handles.text_spunic,'enable','off');
        set(handles.edit_spunic,'enable','off','string','');
    elseif  nmod == -1
        spmod=[];
        set(handles.text_spunic,'enable','off');
        set(handles.edit_spunic,'enable','off','string','');
    else
        spmod=[];
        set(handles.text_spunic,'enable','on');
        set(handles.edit_spunic,'enable','on');
    end

elseif evalin('base','als_opt.multi.ccons')==0

    if nmod == dim
        form_spmod=ones(1,dim);
        spmod(curr_cmat,:)=form_spmod;
        set(handles.text_spunic,'enable','off');
        set(handles.edit_spunic,'enable','off','string','');
    elseif  nmod == 0
        form_spmod=zeros(1,dim);
        spmod(curr_cmat,:)=form_spmod;
        set(handles.text_spunic,'enable','off');
        set(handles.edit_spunic,'enable','off','string','');
    elseif  nmod == -1
        evalin('base','als_opt.unimod.spmod=[]');
        set(handles.text_spunic,'enable','off');
        set(handles.edit_spunic,'enable','off','string','');
    else
        evalin('base','als_opt.unimod.spmod=[]');
        set(handles.text_spunic,'enable','on');
        set(handles.edit_spunic,'enable','on');
    end


end

assignin('base','spmod',spmod);
evalin('base','als_opt.unimod.spmod=spmod;');
evalin('base','clear spmod nmod');


function edit_spunic_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_spunic (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



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

form_spmod= str2num(get(hObject,'String'));
matc=evalin('base','als_opt.multi.matc');
curr_cmat=evalin('base','als_opt.multi.curr_cmat');
spmod=evalin('base','als_opt.unimod.spmod');

if evalin('base','als_opt.multi.ccons')==1
    for i=1:matc;
        spmod(i,:)=form_spmod;
    end
elseif evalin('base','als_opt.multi.ccons')==0
    spmod(curr_cmat,:)=form_spmod;
end

assignin('base','spmod',spmod);
evalin('base','als_opt.unimod.spmod=spmod;');
evalin('base','clear spmod');


% --- Executes during object creation, after setting all properties.
function edit_tolunic_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_tolunic (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


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

rmod= str2num(get(hObject,'String'));

if rmod==1,
    rmod=1.0001;
end

assignin('base','rmod',rmod);
evalin('base','als_opt.unimod.rmod=rmod;');
evalin('base','clear rmod');


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

dim=evalin('base','min(size(als_opt.iniesta))');
j=2;
llistanns(1)={'select...'};
for i=0:1:dim;
    llistnns=[i];
    llistanns(j)={llistnns};
    j=j+1;
end;

set(hObject,'string',llistanns)


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


nsmod=get(hObject,'Value')-2;

assignin('base','nsmod',nsmod);
evalin('base','als_opt.unimod.nsmod=nsmod;');
dim=evalin('base','min(size(als_opt.iniesta))');
matr=evalin('base','als_opt.multi.matr');
curr_cmat=evalin('base','als_opt.multi.curr_cmat');
curr_smat=evalin('base','als_opt.multi.curr_smat');
spsmod=evalin('base','als_opt.unimod.spsmod');

if evalin('base','als_opt.multi.scons')==1

    if nsmod == dim
        spsmod=ones(matr,dim);
        set(handles.text_spunis,'enable','off');
        set(handles.edit_spunis,'enable','off','string','');
    elseif  nsmod == 0
        spsmod=ones(matr,dim);
        set(handles.text_spunis,'enable','off');
        set(handles.edit_spunis,'enable','off','string','');
    elseif  nsmod == -1
        spsmod=[];
        set(handles.text_spunis,'enable','off');
        set(handles.edit_spunis,'enable','off','string','');
    else
        spsmod=[];
        set(handles.text_spunis,'enable','on');
        set(handles.edit_spunis,'enable','on');
    end

elseif evalin('base','als_opt.multi.scons')==0

    if nsmod == dim
        form_spsmod=ones(1,dim);
        spsmod(curr_smat,:)=form_spsmod;
        set(handles.text_spunis,'enable','off');
        set(handles.edit_spunis,'enable','off','string','');
    elseif  nsmod == 0
        form_spsmod=zeros(1,dim);
        spsmod(curr_smat,:)=form_spsmod;
        set(handles.text_spunis,'enable','off');
        set(handles.edit_spunis,'enable','off','string','');
    elseif  nsmod == -1
        evalin('base','als_opt.unimod.spsmod=[]');
        set(handles.text_spunis,'enable','off');
        set(handles.edit_spunis,'enable','off','string','');
    else
        evalin('base','als_opt.unimod.spsmod=[];');
        set(handles.text_spunis,'enable','on');
        set(handles.edit_spunis,'enable','on');
    end


end

assignin('base','spsmod',spsmod);
evalin('base','als_opt.unimod.spsmod=spsmod;');
evalin('base','clear spsmod nsmod');


% --- Executes during object creation, after setting all properties.
function edit_spunis_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_spunis (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

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


form_spsmod= str2num(get(hObject,'String'));
matr=evalin('base','als_opt.multi.matr');
curr_smat=evalin('base','als_opt.multi.curr_smat');
spsmod=evalin('base','als_opt.unimod.spsmod');

if evalin('base','als_opt.multi.scons')==1
    for i=1:matr;
        spsmod(:,i)=form_spsmod;
    end
elseif evalin('base','als_opt.multi.scons')==0
    spsmod(:,curr_smat)=form_spsmod;
end

assignin('base','spsmod',spsmod);
evalin('base','als_opt.unimod.spsmod=spsmod;');
evalin('base','clear spsmod');

% --- Executes during object creation, after setting all properties.
function edit_tolunis_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_tolunis (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

⌨️ 快捷键说明

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