I have two matrices A of size 2×5 and B of size 2×2 such that each column is a feature vector. I want to calculate the euclidean distance between A and B. i.e I want to calculate the euclidean distance between first column of B with every column of A and similarly need to calculate the second column of B with every column of A .
A=rand(5,2); B=rand(2,2); for i=1:2 for j=1:5 d=sqrt(B(i,:)-A(j,:)); endend
Best Answer