📄 ipcascoplotgui.m
字号:
% hObject handle to ipcascoplotNumberOfPlots (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 PlotAll.
function PlotAll_Callback(hObject, eventdata, handles)
% hObject handle to PlotAll (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
varsModel = get(handles.ModelMatrix,'String');
var_indexModel = get(handles.ModelMatrix,'Value');
ModelMatrix = evalin('base',varsModel{var_indexModel(1)});
if (get(handles.classesCheckbox,'Value') == get(handles.classesCheckbox,'min'))
% then checkbox is checked-take approriate action
var_Classes = get(handles.ClassesMatrix,'String');
var_indexClasses = get(handles.ClassesMatrix,'Value');
ClassesMatrix = evalin('base',var_Classes{var_indexClasses(1)});
else
ClassesMatrix = [];
end
PC1 = str2double(get(handles.ipcascoplotComponent1Box,'String'));
PC2 = str2double(get(handles.ipcascoplotComponent2Box,'String'));
fontdimension=str2double(get(handles.fontDimension,'String'));
numberOfPlots = str2double(get(handles.ipcascoplotNumberOfPlots,'String'));
esp1 = str2double(get(handles.esp1,'String'));
esp2 = str2double(get(handles.esp2,'String'));
if PC1 >= PC2
maxPC=PC1
else
maxPC=PC2
end
if (get(handles.ipcascoplotNamesCheckBox,'Value') == get(handles.ipcascoplotNamesCheckBox,'min'))
% then checkbox is checked-take approriate action
set(handles.NameMatrix,'Enable', 'on')
varNames = get(handles.NameMatrix,'String');
var_indexNames = get(handles.NameMatrix,'Value');
Names = evalin('base',varNames{var_indexNames(1)})
ipcascoplotalldim (ModelMatrix,maxPC,Names,ClassesMatrix,numberOfPlots,fontdimension,esp1,esp2);
else
set(handles.NameMatrix,'Enable', 'off')
ipcascoplotalldim (ModelMatrix,maxPC,[],ClassesMatrix,numberOfPlots,fontdimension,esp1,esp2);
end
% --- 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 MakeClassesSamples.
function MakeClassesSamples_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 MakeClassesSamples (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 MakeSamplesNames.
function MakeSamplesNames_Callback(hObject, eventdata, handles)
names=int2str((1:40)')
assignin('base', 'names',names)
% hObject handle to MakeSamplesNames (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.ipcascoplotComponent1Box,'String'));
PC2 = str2double(get(handles.ipcascoplotComponent2Box,'String'));
fontdimension=str2double(get(handles.fontDimension,'String'));
numberOfPlots = str2double(get(handles.ipcascoplotNumberOfPlots,'String'));
esp1 = str2double(get(handles.esp1,'String'));
esp2 = str2double(get(handles.esp2,'String'));
if (get(handles.classesCheckbox,'Value') == get(handles.classesCheckbox,'min'))
% then checkbox is checked-take approriate action
var_Classes = get(handles.ClassesMatrix,'String');
var_indexClasses = get(handles.ClassesMatrix,'Value');
ClassesMatrix = evalin('base',var_Classes{var_indexClasses(1)});
else
ClassesMatrix = [];
end
if (get(handles.ipcascoplotNamesCheckBox,'Value') == get(handles.ipcascoplotNamesCheckBox,'min'))
% then checkbox is checked-take approriate action
set(handles.NameMatrix,'Enable', 'on')
varNames = get(handles.NameMatrix,'String');
var_indexNames = get(handles.NameMatrix,'Value');
Names = evalin('base',varNames{var_indexNames(1)});
ipcascoplotdim(ModelMatrix,PC1,PC2,Names,ClassesMatrix,numberOfPlots,fontdimension,esp1,esp2);
else
set(handles.NameMatrix,'Enable', 'off')
ipcascoplotdim(ModelMatrix,PC1,PC2,[],ClassesMatrix,numberOfPlots,fontdimension,esp1,esp2);
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
% --- Executes on button press in classesCheckbox.
function classesCheckbox_Callback(hObject, eventdata, handles)
% hObject handle to classesCheckbox (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 classesCheckbox
if (get(handles.classesCheckbox,'Value') == get(handles.classesCheckbox,'min'))
% then checkbox is checked-take approriate action
set(handles.ClassesMatrix,'Enable', 'on')
else
set(handles.ClassesMatrix,'Enable', 'off')
end
function esp1_Callback(hObject, eventdata, handles)
% hObject handle to esp1 (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 esp1 as text
% str2double(get(hObject,'String')) returns contents of esp1 as a double
% --- Executes during object creation, after setting all properties.
function esp1_CreateFcn(hObject, eventdata, handles)
% hObject handle to esp1 (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 esp2_Callback(hObject, eventdata, handles)
% hObject handle to esp2 (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 esp2 as text
% str2double(get(hObject,'String')) returns contents of esp2 as a double
% --- Executes during object creation, after setting all properties.
function esp2_CreateFcn(hObject, eventdata, handles)
% hObject handle to esp2 (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 + -