load ekman.dat


prox = ((-1.0)*ekman) + 1.0;


n = size(prox,1);


[torg_coordinates,torg_vaf,torg_vectors,torg_roots] = torgerson(prox,2);

[gutt_coordinates,gutt_vaf,gutt_vectors,gutt_roots] = guttman(prox,2);

torg_vaf

gutt_vaf

for i = 1:n
    objectlabels{i,1} = int2str(i);
end

figure(1)

axis square

plot(torg_coordinates(:,1),torg_coordinates(:,2),'ko')

hold on

text(torg_coordinates(:,1),torg_coordinates(:,2),objectlabels,'fontsize',...
    10,'verticalalignment','bottom')

figure(2)

axis square

plot(gutt_coordinates(:,1),gutt_coordinates(:,2),'ko')

hold on

text(gutt_coordinates(:,1),gutt_coordinates(:,2),objectlabels,'fontsize',...
    10,'verticalalignment','bottom')

t_coord = [torg_coordinates(:,1),torg_coordinates(:,2)]

g_coord = [gutt_coordinates(:,1),gutt_coordinates(:,2)]
    
[d,z,transform] = procrustes(t_coord,g_coord);

figure(3)

axis square

plot(t_coord(:,1),t_coord(:,2),'rx',...
g_coord(:,1),g_coord(:,2),'b.',z(:,1),z(:,2),'go')

hold on

text(torg_coordinates(:,1),torg_coordinates(:,2),objectlabels,'fontsize',8,...
'verticalalignment','bottom')

text(z(:,1),z(:,2),objectlabels,'fontsize',8,'verticalalignment','bottom')

transform(1).b
transform(1).T
transform(1).c

corrcoef([t_coord,g_coord])




