필터 지우기
필터 지우기

Hamming distance between columns of two matrices

조회 수: 2 (최근 30일)
riad didou
riad didou 2021년 11월 10일
편집: riad didou 2021년 11월 10일
Hii
%Just an example
HamDist = pdist2(B,C,'hamming');
[~,ind] = min(HamDist,[],2);
Is there any trick to perform hamming distance between columns of two different binary matrices: A(64 by100) and B(64 by 80), and report the minimum distances?
To understand more : the "A" is a data matrix with 100 sample, and the B has 80 cluster centroids and in terms of clustering i would like to create the indicator matrix based on the minimum distance between A and B.
  댓글 수: 2
Awais Saeed
Awais Saeed 2021년 11월 10일
How aboout padd some zeros in B to make size(A)=size(B) and then find the hamming distance
riad didou
riad didou 2021년 11월 10일
To understand more : the "A" is a data matrix with 100 sample, and the B has 80 cluster centroids and in terms of clustering i would like to create the indicator matrix based on the minimum distance between A and B.

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2021년 11월 10일
HamDist = pdist2(A',B','hamming');
HamDist = HamDist' ;
[~,ind] = min(HamDist,[],2);
  댓글 수: 1
riad didou
riad didou 2021년 11월 10일
but the result of the first line is a real values (HamDist )!!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Hamming에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by