x=input('please type in x location :');
y=input('please type in y location :');
z=input('please type in z location :');

x,y,z

load XYZ;

[d i]=min(sum(([(XYZ(1,:)-(x));(XYZ(2,:)-(y));(XYZ(3,:)-(z))]).^2));
a=spm_readXA(i,'XA.mat');

plot(a)
