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

📄 ipcaloadplotgui.m

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

% Last Modified by GUIDE v2.5 13-Apr-2006 12:19:16

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

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = ipcaloadplotGUI_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.ModelMatrix,'String',vars)
set(handles.VariableMatrix,'String',vars)


% --- Executes on selection change in ModelMatrix.
function ModelMatrix_Callback(hObject, eventdata, handles)

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


% --- Executes during object creation, after setting all properties.
function ModelMatrix_CreateFcn(hObject, eventdata, handles)
% hObject    handle to ModelMatrix (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 selection change in VariableMatrix.
function VariableMatrix_Callback(hObject, eventdata, handles)

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


% --- Executes during object creation, after setting all properties.
function VariableMatrix_CreateFcn(hObject, eventdata, handles)
% hObject    handle to VariableMatrix (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 UpdateButton.
function UpdateButton_Callback(hObject, eventdata, handles)
vars = evalin('base','who');
set(handles.ModelMatrix,'String',vars)
set(handles.VariableMatrix,'String',vars)

% hObject    handle to UpdateButton (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 variableCheck.
function variableCheck_Callback(hObject, eventdata, handles)
if (get(handles.variableCheck,'Value') == get(handles.variableCheck,'min'))
    % then checkbox is checked-take approriate action
     set(handles.VariableMatrix,'Enable', 'on')
   
else
     set(handles.VariableMatrix,'Enable', 'off')
        
end
% hObject    handle to variableCheck (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 variableCheck



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


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



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


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



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

% --- Executes during object creation, after setting all properties.
function numberOfPlots_CreateFcn(hObject, eventdata, handles)
% hObject    handle to numberOfPlots (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 pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (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 pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (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 pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton5 (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 MakeClassesClasses.
function MakeClassesClasses_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;])

% hObject    handle to MakeClassesClasses (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 DoPlot.
function DoPlot_Callback(hObject, eventdata, handles)
%miamatrice = evalin('base',listEntriesIpcascoplotModelMatrix{indexSelectedIpcascoplotModelMatrix(1)})


%evalin('base',['ipcascoplot(Model,PC1,PC2,names,y)'])
varsModel = get(handles.ModelMatrix,'String');
var_indexModel = get(handles.ModelMatrix,'Value');
ModelMatrix = evalin('base',varsModel{var_indexModel(1)});

PC1 = str2double(get(handles.PC1,'String'));
PC2 = str2double(get(handles.PC2,'String'));
fontdimension=str2double(get(handles.fontDimension,'String'))
numberOfPlots = str2double(get(handles.numberOfPlots,'String'));

if (get(handles.variableCheck,'Value') == get(handles.variableCheck,'min'));
    % then checkbox is checked-take approriate action
     set(handles.VariableMatrix,'Enable', 'on');
     varNames = get(handles.VariableMatrix,'String');
     var_indexNames = get(handles.VariableMatrix,'Value');
     Names1 = evalin('base',varNames{var_indexNames(1)});
     Names=int2str(Names1)
     ipcaloadplotdim(ModelMatrix,PC1,PC2,Names,numberOfPlots,fontdimension);
else
     set(handles.VariableMatrix,'Enable', 'off')
     ipcaloadplotdim(ModelMatrix,PC1,PC2,[],numberOfPlots,fontdimension);
end



% hObject    handle to DoPlot (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)





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


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











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


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


⌨️ 快捷键说明

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