⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plotw.m

📁 支持向量域是近几年采用的一种较新的分类器
💻 M
字号:
function h = plotw(w,nrc)%PLOTW Plot the classifier w.%%    h = plotw(w,nrc)%% Please use plotc instead.% Copyright: D.M.J. Tax, D.M.J.Tax@prtools.org% Faculty EWI, Delft University of Technology% P.O. Box 5031, 2600 GA Delft, The Netherlandsif nargin<2  nrc = 10;end% first determine the grid:V = axis;[grid,x,y] = makegriddat(V(1),V(2),V(3),V(4));% determine the sizelx = length(x);ly = length(y);% make the outputz = grid*w;% see if z has the right sizeif (size(z,2)>2)  error('Data z does not have appropriate size');endif (size(z,2)==2)  z = z(:,1) - z(:,2);  if (nrc==1)    contour(x,y,reshape(+z,ly,lx),[0 0],'k');  else    [c,h] = contourf(x,y,reshape(+z,ly,lx),nrc);    hold on;    [c2,h2] = contour(x,y,reshape(+z,ly,lx),[0 0]);    set(h2,'linewidth',2,'edgecolor','w');  endelse  hold on;  if (nrc==1)    [c,h] = contour(x,y,reshape(+z,ly,lx),[0 0],'k');  else    [c,h] = contourf(x,y,reshape(+z,ly,lx),nrc);  endendreturn

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -