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

📄 als2004m.m

📁 多元曲线解析-交替最小二乘法,MCR-ALS
💻 M
📖 第 1 页 / 共 5 页
字号:
end


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


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

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

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; 

dim=evalin('base','min(size(als_opt.iniesta))');
nexp=evalin('base','als_opt.nexp');

if nsmod == dim
    spsmod=ones(1,dim);
    set(handles.text_spunis,'enable','off');
    set(handles.edit_spunis,'enable','off','string','');
elseif  nsmod == 0
    spsmod=zeros(1,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


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_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

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

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

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

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

if smod==1,
    smod=1.0001;
end

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


% *************************************************************************
% closure
% *************************************************************************


% --- Executes on button press in check_clos.
function check_clos_Callback(hObject, eventdata, handles)
% hObject    handle to check_clos (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of check_clos

closure=get(hObject,'Value');

if closure==1;
    set(handles.radio_cclos,'enable','on');
    set(handles.radio_sclos,'enable','on');
else
    set(handles.check_vclos,'enable','off','value',0);
    set(handles.text_vclos1,'enable','off');
    set(handles.edit_vclos1,'enable','off','string',' ');
    set(handles.text_vclos2,'enable','off');
    set(handles.edit_vclos2,'enable','off','string',' ');
    
    set(handles.radio_cclos,'enable','off','value',0);
    set(handles.radio_sclos,'enable','off','value',0);
    
    set(handles.text_nclos,'enable','off');
    set(handles.popup_nclos,'enable','off','value',1);
    
    set(handles.text_1clos,'enable','off');
    set(handles.edit_1clos,'enable','off','string',' ');
    set(handles.text_2clos,'enable','off');
    set(handles.edit_2clos,'enable','off','string',' '); 
    
    set(handles.text_1closcond,'enable','off');
    set(handles.popup_1closcond,'enable','off','value',1);
    set(handles.text_2closcond,'enable','off');
    set(handles.popup_2closcond,'enable','off','value',1);
    
    set(handles.check_1clos,'enable','off','value',0);
    set(handles.check_2clos,'enable','off','value',0);
    set(handles.text_1spclos,'enable','off');
    set(handles.edit_1spclos,'enable','off','string',' ');
    set(handles.text_2spclos,'enable','off');
    set(handles.edit_2spclos,'enable','off','string',' ');
    
    evalin('base','als_opt=rmfield(als_opt,''closure'');');
end;

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

vc=0;
assignin('base','vc',vc);
evalin('base','als_opt.closure.vc=vc;');
evalin('base','clear vc');


% --- Executes on button press in radio_cclos.
function radio_cclos_Callback(hObject, eventdata, handles)
% hObject    handle to radio_cclos (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of radio_cclos

dc=1;

set(handles.radio_sclos,'enable','off','value',0);

set(handles.text_nclos,'enable','on');
set(handles.popup_nclos,'enable','on','value',1);

set(handles.text_1clos,'enable','off');
set(handles.edit_1clos,'enable','off','string',' ');
set(handles.text_2clos,'enable','off');
set(handles.edit_2clos,'enable','off','string',' '); 

set(handles.text_1closcond,'enable','off');
set(handles.popup_1closcond,'enable','off','value',1);
set(handles.text_2closcond,'enable','off');
set(handles.popup_2closcond,'enable','off','value',1);

set(handles.check_1clos,'enable','off','value',0);
set(handles.check_2clos,'enable','off','value',0);
set(handles.text_1spclos,'enable','off');
set(handles.edit_1spclos,'enable','off','string',' ');
set(handles.text_2spclos,'enable','off');
set(handles.edit_2spclos,'enable','off','string',' ');

set(handles.check_vclos,'enable','off');
set(handles.text_vclos1,'enable','off');
set(handles.edit_vclos1,'enable','off','string',' ');
set(handles.text_vclos2,'enable','off');
set(handles.edit_vclos2,'enable','off','string',' ');

assignin('base','dc',dc);
evalin('base','als_opt.closure.dc=dc;');
evalin('base','clear dc');


% --- Executes on button press in radio_sclos.
function radio_sclos_Callback(hObject, eventdata, handles)
% hObject    handle to radio_sclos (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of radio_sclos

dc=2;

set(handles.radio_cclos,'enable','off','value',0);

set(handles.text_nclos,'enable','on');
set(handles.popup_nclos,'enable','on','value',1);

set(handles.text_1clos,'enable','off');
set(handles.edit_1clos,'enable','off','string',' ');
set(handles.text_2clos,'enable','off');
set(handles.edit_2clos,'enable','off','string',' '); 

set(handles.text_1closcond,'enable','off');
set(handles.popup_1closcond,'enable','off','value',1);
set(handles.text_2closcond,'enable','off');
set(handles.popup_2closcond,'enable','off','value',1);

set(handles.check_1clos,'enable','off','value',0);
set(handles.check_2clos,'enable','off','value',0);
set(handles.text_1spclos,'enable','off');
set(handles.edit_1spclos,'enable','off','string',' ');
set(handles.text_2spclos,'enable','off');
set(handles.edit_2spclos,'enable','off','string',' ');

set(handles.check_vclos,'enable','off');
set(handles.text_vclos1,'enable','off');
set(handles.edit_vclos1,'enable','off','string',' ');
set(handles.text_vclos2,'enable','off');
set(handles.edit_vclos2,'enable','off','string',' ');

assignin('base','dc',dc);
evalin('base','als_opt.closure.dc=dc;');
evalin('base','clear dc');


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

⌨️ 快捷键说明

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