how to calculate hamming distance between vectors in matrix
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
jim
el 19 de Oct. de 2014
Comentada: Deeksha Varshney
el 2 de Nov. de 2017
i try this code as:
a = [1 0 1 0 1;
0 1 1 1 0;
1 1 0 0 1];
D = pdist(a,'minkowski',1)
the answer came as: 4 2 4 while it should be : 0 4 4 how to solve it? and to make run for bigger matrix as (50x30)
1 comentario
Deeksha Varshney
el 2 de Nov. de 2017
firstly change minkowski to hamming then may be you will get correct answer.
Respuesta aceptada
the cyclist
el 19 de Oct. de 2014
Editada: the cyclist
el 19 de Oct. de 2014
Well, this doesn't give your expected output, but
D = pdist(a,'hamming')
gives the Hamming distance between each pair of rows.
I'm not sure why you used the input argument "minkowski".
12 comentarios
the cyclist
el 21 de Oct. de 2014
The best form of thanks to accept the answer, which indicates to others (who may have a similar problem) that this resolved the question you posed.
Más respuestas (0)
Ver también
Categorías
Más información sobre Hamming en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!