function varargout = mani(varargin)
% mani: MANIfold learning demonstration GUI
% by Todd Wittman, Department of Mathematics, University of Minnesota
% E-mail wittman@math.umn.edu with comments & questions.
% MANI Website: http://www.math.umn.edu/~wittman/mani/index.html
% Last Modified by GUIDE v2.5 10-Apr-2005 13:28:36
%
% Methods obtained from various authors.
% MDS -- Michael Lee
% ISOMAP -- J. Tenenbaum, de Silva, & Langford
% LLE -- Sam Roweis & Lawrence Saul
% Hessian LLE -- D. Donoho & C. Grimes
% Laplacian -- M. Belkin & P. Niyogi
% Diffusion Map -- R. Coifman & S. Lafon
% LTSA -- Zhenyue Zhang & Hongyuan Zha
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @mani_OpeningFcn, ...
'gui_OutputFcn', @mani_OutputFcn, ...
'gui_LayoutFcn', @mani_LayoutFcn, ...
'gui_Callback', []);
if nargin & isstr(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 mani is made visible.
function mani_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
axes(handles.maniAXES);
axis off;
axes(handles.embedAXES);
axis off;
handles.X = 0;
handles.ColorVector = 0;
handles.Y = 0;
handles.isExample = 0;
handles.K = 12;
handles.d = 2;
handles.sigma = 1.45;
handles.runTime = 0;
handles.alpha = 0;
guidata(hObject, handles);
warning off;
% --- Outputs from this function are returned to the command line.
function varargout = mani_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function MatrixEdit_CreateFcn(hObject, eventdata, handles)
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function MatrixEdit_Callback(hObject, eventdata, handles)
% Hints: get(hObject,'String') returns contents of MatrixEdit as text
% str2double(get(hObject,'String')) returns contents of MatrixEdit as a double
function FileEdit_CreateFcn(hObject, eventdata, handles)
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function FileEdit_Callback(hObject, eventdata, handles)
% Hints: get(hObject,'String') returns contents of FileEdit as text
% str2double(get(hObject,'String')) returns contents of FileEdit as a double
% --- Executes on button press in LoadMatrix.
function LoadMatrix_Callback(hObject, eventdata, handles)
handles.X = evalin ('base', get(handles.MatrixEdit,'String'));
handles.isExample = 0;
guidata(hObject, handles);
PlotManifold(hObject,eventdata,handles,0);
updateString{1} = ['Matrix ',get(handles.MatrixEdit,'String'),' loaded.'];
set(handles.UpdatesText,'String',updateString);
guidata(hObject, handles);
% --- Executes on button press in LoadFile.
function LoadFile_Callback(hObject, eventdata, handles)
Xtemp = dlmread(get(handles.FileEdit,'String'),' ');
[m,n] = size(Xtemp);
% Check if last column is all zeros. Reading error.
if max(abs(Xtemp(:,n))) == 0
Xtemp = Xtemp(1:m,1:n-1);
end;
handles.X = Xtemp;
handles.isExample = 0;
guidata(hObject, handles);
PlotManifold(hObject,eventdata,handles,0);
updateString{1} = ['File ',get(handles.FileEdit,'String'),' loaded.'];
set(handles.UpdatesText,'String',updateString);
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function ExampleMenu_CreateFcn(hObject, eventdata, handles)
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on selection change in ExampleMenu.
function ExampleMenu_Callback(hObject, eventdata, handles)
% Hints: contents = get(hObject,'String') returns ExampleMenu contents as cell array
% contents{get(hObject,'Value')} returns selected item from ExampleMenu
exampleValue = get(handles.ExampleMenu,'Value');
switch exampleValue
case 1 % Swiss Roll
set(handles.text19,'String','Z Scaling =');
set(handles.ParamEdit,'String','1.0');
case 2 % Swiss Hole
set(handles.text19,'String','Z Scaling =');
set(handles.ParamEdit,'String','1.0');
case 3 % Corner Planes
set(handles.text19,'String','Lift Angle =');
set(handles.ParamEdit,'String','45.0');
case 4 % Punctured Sphere
set(handles.text19,'String','Z Scaling =');
set(handles.ParamEdit,'String','1.0');
case 5 % Twin Peaks
set(handles.text19,'String','Z Scaling =');
set(handles.ParamEdit,'String','1.0');
case 6 % 3D Clusters
set(handles.text19,'String','# Clusters =');
set(handles.ParamEdit,'String','3');
case 7 % Toroidal Helix
set(handles.text19,'String','Sample Rate =');
set(handles.ParamEdit,'String','1.0');
case 8 % Gaussian
set(handles.text19,'String','Sigma =');
set(handles.ParamEdit,'String','1.0');
case 9 % Occluded Disks
set(handles.text19,'String','Occluder r =');
set(handles.ParamEdit,'String','1.0');
end;
guidata(hObject,handles);
% --- Executes during object creation, after setting all properties.
function DimEdit_CreateFcn(hObject, eventdata, handles)
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function DimEdit_Callback(hObject, eventdata, handles)
% Hints: get(hObject,'String') returns contents of DimEdit as text
% str2double(get(hObject,'String')) returns contents of DimEdit as a double
% --- Executes during object creation, after setting all properties.
function KEdit_CreateFcn(hObject, eventdata, handles)
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function KEdit_Callback(hObject, eventdata, handles)
% Hints: get(hObject,'String') returns contents of KEdit as text
% str2double(get(hObject,'String')) returns contents of KEdit as a double
% --- Executes during object creation, after setting all properties.
function REdit_CreateFcn(hObject, eventdata, handles)
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes during object creation, after setting all properties.
function SigmaEdit_CreateFcn(hObject, eventdata, handles)
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function SigmaEdit_Callback(hObject, eventdata, handles)
% Hints: get(hObject,'String') returns contents of SigmaEdit as text
% str2double(get(hObject,'String')) returns contents of SigmaEdit as a double
% --- Executes on button p
- 1
- 2
前往页