function [out1, out2, out3]=cor(source1,source2,source3,target1,target2,target3);

% normalization of three Euclidean distances of source
s1=normc(source1);
s2=normc(source2);
s3=normc(source3);

% normalization of three Euclidean distances of target
t1=normc(target1);
t2=normc(target2);
t3=normc(target3);

% using a matlab correaltion coefficent function
% if the two arrays size aren't similar it pads zero in it.

out1=xcorr(s1,t1);
out2=xcorr(s2,t2);
out3=xcorr(s3,t3);

figure;
        subplot(1,3,1), plot(out1);
        subplot(1,3,1), title('Starting');
        subplot(1,3,2), plot(out2);
        subplot(1,3,2), title('Ending');
        subplot(1,3,3), plot(out3);
        subplot(1,3,3), title('Centroid');

return
      