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

📄 exp_clipline.m

📁 具有图形操作界面的支持向量机多类分类实验系统.全部用Matlab实现,可以实现多种分类识别. 这是本人的毕业设计的附属程序
💻 M
字号:
% CLIPLINE clips line into given window.
%
% Synopsis:
%  [x1,y1,x2,y2,inside] = clipline(W,b,window)
%
% Description:
%  This function returns 2d points (x1,y1) and (x2,y2) 
%  of a line segment given by line
%    W'*x + b = 0
%
%  clipped to the given window.
%
% Input:
%  W [2x1] Normal of line.
%  b [1x1] Line threshold.
%  window [4x1] Contains [left right top bottom].
%
% Output:
%  x1 [1x1], y1 [1x1] The first point of line segment.
%  x2 [1x1], y2 [1x1] The second point of line segment.
%  inside [1x1] 1 if line W'*x+b=0 intersects the window. 
%  
% Example:
%  figure; hold on;
%  axis([-1 1 -1 1]);
%  window = 0.5*axis;
%  [x1,y1,x2,y2]=clipline([-1;1],0,window);
%  plot([x1 x2],[y1 y2]);

figure; hold on;
  axis([-1 1 -1 1]);
  window = 0.5*axis;
  [x1,y1,x2,y2]=clipline([-1;1],0,window);
  plot([x1 x2],[y1 y2]);
  
  %  [x1,y1,x2,y2]=clipline([-1;1],-0.5,window);

⌨️ 快捷键说明

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