Got Questions? Get Answers.
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:
hamming distance

Subject: hamming distance

From: Dani Camps

Date: 18 Apr, 2003 20:26:28

Message: 1 of 3

I think that the hamming distance of two vectors is the number of different
components that thy have, I've been looking for this function in matlab 6.0
R12 but it does not appear, does somebody know sth about this function?

I know that it's easy to implement it using a for loop but I'm sure that the
matlab's function will be more efficient than mine.

Thanks in advance

Subject: hamming distance

From: Aditya Utturwar

Date: 18 Apr, 2003 14:40:21

Message: 2 of 3

Hi Dani,


will this help you better ?


----------
%for vectors a and b


hamming_dist(a,b) = sum(a~=b)


cheers,
aditya


Dani Camps wrote:
>
>
> I think that the hamming distance of two vectors is the number of
different
> components that thy have, I've been looking for this function in
matlab 6.0
> R12 but it does not appear, does somebody know sth about this
function?
>
> I know that it's easy to implement it using a for loop but I'm sure
that
> the
> matlab's function will be more efficient than mine.
>
> Thanks in advance
>
>
>

Subject: hamming distance

From: Dani Camps

Date: 18 Apr, 2003 21:24:11

Message: 3 of 3


"Aditya Utturwar" <aadi007_rubbish@yahoo.com> escribió en el mensaje
news:eebca51.0@WebX.raydaftYaTP...
> Hi Dani,
>
>
> will this help you better ?
>
>
> ----------
> %for vectors a and b
>
>
> hamming_dist(a,b) = sum(a~=b)
>
>
> cheers,
> aditya
>


Thanks, it was exactly what I need

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