plot_data.m
来自「一个简单的贝叶斯分类器」· M 代码 · 共 16 行
M
16 行
function plotdata(test,testclass)
[m,n]=size(test);
for(i=1:m)
if(testclass(i,:)==[1,0,0])
h=plot(test(i,1),test(i,2),'LineWidth',1,'Marker','x','Color','r');
hold on
end
if(testclass(i,:)==[0,1,0])
h=plot(test(i,1),test(i,2),'LineWidth',1,'Marker','o','Color','b');
hold on
end
if(testclass(i,:)==[0,0,1])
h=plot(test(i,1),test(i,2),'LineWidth',1,'Marker','*','Color','k');
hold on
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?