function D = fastdist(x,y)
%% Calculated Euclidean distance between the samples with the centroid of
%% each group
%Input
%     x: the matrix of the data 1
%     y£şthe matrix of the data 2
% Output
%     D: the Euclideam distances between two sets of objetcs


D = ((sum(y'.^2))'*ones(1,size(x,1)))+(ones(size(y,1),1)*(sum(x'.^2)))-2*(y*x');