find_point

PURPOSE ^

FIND_POINT - find closest point

SYNOPSIS ^

function f=find_point(tabx,taby,pointx,pointy)

DESCRIPTION ^

FIND_POINT - find closest point

   find which point of the list (tabx,taby) is
   the closest to (poinx,pointy)

   Usage:
      f=find_point(tabx,taby,pointx,pointy)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function f=find_point(tabx,taby,pointx,pointy)
0002 %FIND_POINT - find closest point
0003 %
0004 %   find which point of the list (tabx,taby) is
0005 %   the closest to (poinx,pointy)
0006 %
0007 %   Usage:
0008 %      f=find_point(tabx,taby,pointx,pointy)
0009 
0010 distance=sqrt((tabx-pointx).^2+(taby-pointy).^2);
0011 f=find(distance==min(min(distance)));

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003