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

📄 ipcagui.m

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

% Last Modified by GUIDE v2.5 13-Apr-2006 11:56:23

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @ipcaGUI_OpeningFcn, ...
                   'gui_OutputFcn',  @ipcaGUI_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 ipcaGUI is made visible.
function ipcaGUI_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 ipcaGUI (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

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


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


% --- Outputs from this function are returned to the command line.
function varargout = ipcaGUI_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.ListMatrix,'String',vars)
set(handles.ListAxis,'String',vars)
set(handles.IntervalsMatrix,'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 NumberOfComponentsBox_Callback(hObject, eventdata, handles)
% hObject    handle to NumberOfComponentsBox (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 NumberOfComponentsBox as text
%        str2double(get(hObject,'String')) returns contents of NumberOfComponentsBox as a double

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

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

% --- Executes during object creation, after setting all properties.
function ListAxis_CreateFcn(hObject, eventdata, handles)
% hObject    handle to ListAxis (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.ListMatrix,'String',vars)
set(handles.ListAxis,'String',vars)
set(handles.IntervalsMatrix,'String',vars)


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

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

⌨️ 快捷键说明

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