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

📄 ipcagui.m

📁 这是国外一个PLS工具箱
💻 M
📖 第 1 页 / 共 2 页
字号:
% hObject    handle to loadFilesButton (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

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

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




% --- Executes on button press in doIpca.
function doIpca_Callback(hObject, eventdata, handles)


list_entriesmatrix = get(handles.ListMatrix,'String');
index_selectedmatrix = get(handles.ListMatrix,'Value');
mymatrix = evalin('base',list_entriesmatrix{index_selectedmatrix(1)});

list_entriesAxis = get(handles.ListAxis,'String');
index_selecteAxis = get(handles.ListAxis,'Value');
myAxis = evalin('base',list_entriesAxis{index_selecteAxis(1)});


list_IntervalsMatrix = get(handles.IntervalsMatrix,'String');
index_IntervalsMatrix = get(handles.IntervalsMatrix,'Value');
Intervals = evalin('base',list_IntervalsMatrix{index_IntervalsMatrix(1)});

preprocindex =  int2str(get(handles.preprocessListbox,'Value'));

 switch preprocindex
    case {'1'}
       preproc='none';
    case '2'
       preproc='mean';
    case '3'
       preproc='auto';
    case '4'
       preproc='mscmean';
    case '5'
       preproc='mscauto';
end
assignin('base', 'preproc', preproc);

numberOfComponents = str2double(get(handles.NumberOfComponentsBox,'String'));
numberOfIntervals = str2double(get(handles.IntervalsBox,'String'));
myModelName= get(handles.nameBox,'String')


if (get(handles.checkIntervals,'Value') == get(handles.checkIntervals,'Max')) &  (get(handles.checkAxis,'Value') == get(handles.checkAxis,'Max'))
    Model=ipca(mymatrix,numberOfComponents ,preproc,Intervals,myAxis);
elseif (get(handles.checkIntervals,'Value') == get(handles.checkIntervals,'Min')) &  (get(handles.checkAxis,'Value') == get(handles.checkAxis,'Min'))
    Model=ipca(mymatrix,numberOfComponents ,preproc,numberOfIntervals,[]);
elseif (get(handles.checkIntervals,'Value') == get(handles.checkIntervals,'Max')) &  (get(handles.checkAxis,'Value') == get(handles.checkAxis,'Min'))
    Model=ipca(mymatrix,numberOfComponents,preproc,Intervals,[]);
else
    Model=ipca(mymatrix,numberOfComponents,preproc,numberOfIntervals,myAxis);
end

%a='maurine'
assignin('base', myModelName , Model)

 


% --- Executes on selection change in preprocessListbox.
function preprocessListbox_Callback(hObject, eventdata, handles)
%contents = get(handles.preprocessListbox,'String')



% hObject    handle to preprocessListbox (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 preprocessListbox contents as cell array
%        contents{get(hObject,'Value')} returns selected item from preprocessListbox


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




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

ipcascoplotGUI



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



% --- Executes on button press in makeManualIntervals.
function makeManualIntervals_Callback(hObject, eventdata, handles)
%           VIS       NIR       NOISE
%        st1 end1  st2  end2  st3  end3
int_vec=[1   200   201  500   501  926];
assignin('base', 'int_vec',int_vec);
% hObject    handle to makeManualIntervals (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)




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


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


% --- Executes on button press in checkIntervals.
function checkIntervals_Callback(hObject, eventdata, handles)
if (get(handles.checkIntervals,'Value') == get(handles.checkIntervals,'Max'))
    % then checkbox is not checked 
     set(handles.IntervalsBox,'Enable', 'off')
     set(handles.IntervalsMatrix,'Enable', 'on')
else
     set(handles.IntervalsBox,'Enable', 'on')
     set(handles.IntervalsMatrix,'Enable', 'off') 
end
% hObject    handle to checkIntervals (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 checkIntervals




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


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




% --- Executes on button press in checkAxis.
function checkAxis_Callback(hObject, eventdata, handles)
% hObject    handle to checkAxis (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 checkAxis
if (get(handles.checkAxis,'Value') == get(handles.checkAxis,'Max'))
    % then checkbox is  checked 
     set(handles.ListAxis,'Enable', 'on')
    
else
     set(handles.ListAxis,'Enable', 'off')
     
end






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

IpcaloadplotGUI

⌨️ 快捷键说明

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