I need to find out the difference of every element of H_A with every element in H_B, here is my approach
H_A=reshape(H_A,1,[]);
H_B=reshape(H_B,1,[]);
for i=1:SIZE^2
D(i,:)=((H_A(i)-H_B)).^2;
end
can this be vectorized for speed.