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

📄 dynbiplsgui.m

📁 这是国外一个PLS工具箱
💻 M
📖 第 1 页 / 共 2 页
字号:
function varargout = dynbiplsGUI(varargin)
% DYNBIPLSGUI M-file for dynbiplsGUI.fig
%      DYNBIPLSGUI, by itself, creates a new DYNBIPLSGUI or raises the existing
%      singleton*.
%
%      H = DYNBIPLSGUI returns the handle to a new DYNBIPLSGUI or the handle to
%      the existing singleton*.
%
%      DYNBIPLSGUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in DYNBIPLSGUI.M with the given input arguments.
%
%      DYNBIPLSGUI('Property','Value',...) creates a new DYNBIPLSGUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before dynbiplsGUI_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to dynbiplsGUI_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 dynbiplsGUI

% Last Modified by GUIDE v2.5 06-Apr-2006 16:50:35

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

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

% Update handles structure
guidata(hObject, handles);

% Populate the listbox
%set(handles.ListMatrix,'Value',[])


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


% --- Outputs from this function are returned to the command line.
function varargout = dynbiplsGUI_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;

vars = evalin('base','who');
set(handles.Ymatrix,'String',vars)
set(handles.previousRun,'String',vars)
set(handles.Xmatrix,'String',vars)
% --- Executes on selection change in ListMatrix.
function ListMatrix_Callback(hObject, eventdata, handles)





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


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



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

% --- Executes during object creation, after setting all properties.
function seqintBox_CreateFcn(hObject, eventdata, handles)
% hObject    handle to seqintBox (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 selection change in preProcessListbox.
function preProcessListbox_Callback(hObject, eventdata, handles)
% 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



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


% --- Executes during object creation, after setting all properties.
function Intervals_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Intervals (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 selection change in canc.
function ListAxis_Callback(hObject, eventdata, handles)
function [myAxis] = get_Axis_names(handles)
list_entriesAxis = get(handles.canc,'String')
index_selecteAxis = get(handles.canc,'Value')
myAxis = list_entriesAxis{index_selecteAxis(1)}

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

% --- Executes during object creation, after setting all properties.
function ListAxis_CreateFcn(hObject, eventdata, handles)
% hObject    handle to canc (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 makeClasses.
function makeClasses_Callback(hObject, eventdata, handles)
assignin('base', 'classes',[1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;])

% --- Executes on button press in LoadDemoSet.
function LoadDemoSet_Callback(hObject, eventdata, handles)
nirbeer=load('Nirbeer');
assignin('base', 'nirbeer',nirbeer);
xaxis=nirbeer.xaxis;
Xcal=nirbeer.Xcal;
ycal=nirbeer.ycal; 
Xtest=nirbeer.Xtest;
ytest=nirbeer.ytest;
assignin('base', 'xaxis',xaxis);
assignin('base', 'Xcal',Xcal);
assignin('base', 'ycal',ycal);
assignin('base', 'Xtest',Xtest);
assignin('base', 'Xcal',Xcal);


% --- Executes on button press in UpdateWorkspace.
function UpdateWorkspace_Callback(hObject, eventdata, handles)

vars = evalin('base','who');
set(handles.Xmatrix,'String',vars)
set(handles.listbox7,'String',vars)
set(handles.Ymatrix,'String',vars)

% --- Executes on button press in loadFilesButton.
function loadFilesButton_Callback(hObject, eventdata, handles)

filename = uigetfile ('*.*')
myfile= load (filename)
assignin('base', 'myfile', myfile)

% 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)


% --- Executes on button press in doDyn.
function doDyn_Callback(hObject, eventdata, handles)


list_entriesXmatrix = get(handles.Xmatrix,'String');
index_selectedXmatrix = get(handles.Xmatrix,'Value');
mymatrix = evalin('base',list_entriesXmatrix{index_selectedXmatrix(1)});


list_entriesYmatrix = get(handles.Ymatrix,'String');
index_selectedYmatrix = get(handles.Ymatrix,'Value');
myYmatrix = evalin('base',list_entriesYmatrix{index_selectedYmatrix(1)});


dataset =[mymatrix myYmatrix];

modelname = get(handles.modelname,'String');

nooflv = str2double(get(handles.edit11,'String'));
MinNoVars = str2double(get(handles.VariablesBox,'String'));
c = str2double(get(handles.edit10,'String'));

if (get(handles.checkIntervals,'Value') == get(handles.checkIntervals,'min'))
    
    seqint=str2double(get(handles.seqintBox,'String'))
     
else
    seqintend=str2double(get(handles.EndInterval,'String'))
    seqintstart=str2double(get(handles.StartInterval,'String'))
    seqint = [seqintstart : seqintend]
end
    
if (get(handles.checkbox1,'Value') == get(handles.checkbox1,'Max'))
     var=bipls_dyn(dataset,nooflv,seqint,MinNoVars,varold,c)
else
     var=bipls_dyn(dataset,nooflv,seqint,MinNoVars)
     
end
    
assignin('base', modelname, var)

 


% --- 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 cancellami.
% function plotGUI_Callback(hObject, eventdata, handles)
% % hObject    handle to cancellami (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% 
% ipcaplotGUI



function VariablesBox_Callback(hObject, eventdata, handles)
% hObject    handle to VariablesBox (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 VariablesBox as text
%        str2double(get(hObject,'String')) returns contents of VariablesBox 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.seqintBox,'Enable', 'off')
     set(handles.EndInterval,'Enable', 'on')
     set(handles.StartInterval,'Enable', 'on')
else
     set(handles.seqintBox,'Enable', 'on')
     set(handles.EndInterval,'Enable', 'off')
     set(handles.StartInterval,'Enable', 'off') 
end
% hObject    handle to checkIntervals (see GCBO)

⌨️ 快捷键说明

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