Hamming distance between column-wise of two matrices

Is there any MATLAB trick to perform hamming distance between columns of two different binary matrices(-1 1): A(64 by100) and B(64 by 80), and report the minimum distances? A is a data matrix with 100 samples, and B has 80 cluster centroids and in terms of clustering i would like to create the indicator matrix based on the minimum hamming distance between A and B.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Just an erroneous MATLAB example
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HamDist = pdist2(B,C,'hamming');
[~,ind] = min(HamDist,[],2);

Topic distance matlab clustering

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.