plotdata.m
来自「具有图形操作界面的支持向量机多类分类实验系统.全部用Matlab实现,可以实现多」· M 代码 · 共 24 行
M
24 行
function plotdata(X, Y, x1ran, x2ran)
% PLOTDATA - Plot 2D data set
%
hold on;
%X=X';Y=Y';
ind = find(Y==1);
plot(X(ind,1), X(ind,2), 'ks'); %用黑色方框标记一类数据
%plot(X(1,ind), X(2,ind), 'ks');
ind = find(Y==2);
plot(X(ind,1), X(ind,2), 'mo'); %用紫色圆点标记另一类数据
%plot(X(1,ind), X(2,ind), 'kx');
%text(X(:,1)+.2,X(:,2), int2str([1:length(Y)]'));
%text(X(1,:)+.2,X(2,:), int2str([1:length(Y)]'));
%axis([x1ran x2ran]);
axis xy;
%X=X';Y=Y';
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?