plotmanifold.m
来自「流形学习程序」· M 代码 · 共 47 行
M
47 行
function PlotManifold (hObject, eventdata, handles, plotNumber)
% --- Plot the input manifold.
[m,n] = size(handles.X);
if get(handles.ColorCheck,'Value') == 1 & handles.isExample == 0
handles.ColorVector = evalin ('base',get(handles.ColorEdit,'String'));
Clength = length(handles.ColorVector);
if Clength < m
handles.ColorVector(Clength+1:m) = handles.ColorVector(Clength);
elseif Clength > m
handles.ColorVector = handles.ColorVector(1:m);
end;
end;
guidata(hObject, handles);
if plotNumber == 0
axes(handles.maniAXES);
else
figure;
subplot(331);
end;
if n == 2
if get(handles.ColorCheck,'Value') == 1 | handles.isExample == 1
scatter(handles.X(:,1),handles.X(:,2),12,handles.ColorVector,'filled');
else
scatter(handles.X(:,1),handles.X(:,2),12,'filled');
end;
axis tight;
elseif n == 3
if get(handles.ColorCheck,'Value') == 1 | handles.isExample == 1
scatter3(handles.X(:,1),handles.X(:,2),handles.X(:,3),12,handles.ColorVector,'filled');
else
scatter3(handles.X(:,1),handles.X(:,2),handles.X(:,3),12,'filled');
end;
axis tight;
elseif n == 1
if get(handles.ColorCheck,'Value') == 1 | handles.isExample == 1
scatter(handles.X(:,1),ones(m,1),12,handles.ColorVector,'filled');
else
scatter(handles.X(:,1),ones(m,1),12,'filled');
end;
axis tight;
else
cla;
axis([-1 1 -1 1]);
text(-0.7,0,'Only plots 2D or 3D data');
axis off;
end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?