Home > src > calc2Dist.m

calc2Dist

PURPOSE ^

Notes: calculates 2-norm distance from target vector to all query vectors

SYNOPSIS ^

function dist = calc2Dist( target, query)

DESCRIPTION ^

 Notes: calculates 2-norm distance from target vector to all query vectors

 syntax:  dist = calcEuclidDist( target, query)

 Inputs:
   target: (d by 1) vector of the target vector
   query: (d by N) matrix of the query vectors (dimensionality is d, num
       samples is N )
 
 Outputs:
   dist: vector of all 2-Norm distances

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Notes: calculates 2-norm distance from target vector to all query vectors
0002 %
0003 % syntax:  dist = calcEuclidDist( target, query)
0004 %
0005 % Inputs:
0006 %   target: (d by 1) vector of the target vector
0007 %   query: (d by N) matrix of the query vectors (dimensionality is d, num
0008 %       samples is N )
0009 %
0010 % Outputs:
0011 %   dist: vector of all 2-Norm distances
0012 
0013 function dist = calc2Dist( target, query)
0014 
0015 
0016 dist = ( repmat(target,1,size(query,2)) - query);
0017 dist = sqrt(sum(dist.^2,1));
0018         
0019

Generated on Wed 20-Jan-2016 11:50:43 by m2html © 2005