Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Normalized euclidan distance

Subject: Normalized euclidan distance

From: Anna

Date: 21 Apr, 2009 06:20:31

Message: 1 of 2

Is there a command in MatLab to calculate the normalized euclidean distance between to series x and y? What I want to do is:
(((x1-y1)/x1)^2+((x2-y2)/x2)^2+((xn-yn)/xn)^2)^0.5

Thanks!

Subject: Normalized euclidan distance

From: Roger Stafford

Date: 21 Apr, 2009 07:28:02

Message: 2 of 2

Anna <annek@ifm.liu.se> wrote in message <3613025.4494.1240294862489.JavaMail.jakarta@nitrogen.mathforum.org>...
> Is there a command in MatLab to calculate the normalized euclidean distance between to series x and y? What I want to do is:
> (((x1-y1)/x1)^2+((x2-y2)/x2)^2+((xn-yn)/xn)^2)^0.5
>
> Thanks!

  Anna, I think you really want this:

 (((x1-y1)/s1)^2+((x2-y2)/s2)^2+((xn-yn)/sn)^2)^0.5

where s1, s2, and s3 are the standard deviations in the three respective x1, x2, x3 coordinates over a given sample set. This is the normalized euclidean distance from a point [y1,y2,y3] to a point [x1,x2,x3] of the sample set. It assumes that the covariance matrix is diagonal.

  The closest I can come to in matlab functions for this is 'mahal' in the statistics toolbox which calculates the Mahalanobis distance, a more general form than the normalized euclidean distance which makes no such assumption as above. See the Wikipedia web site at:

 http://en.wikipedia.org/wiki/Mahalanobis_distance

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us