% calculate the distance between any two points.

ncol = 2000; 
a = rand(3,ncol);
b = rand(3,ncol);

tic;

c = zeros(ncol,ncol);

for j =1:ncol
    for i = 1:ncol
        c(i,j) = norm( a(:,j)-b(:,i) );
    end
end

toc;

