
clear all
clf
clc

%HERE ARE THE DATA (OF KOSMAS)
xo=126.5;
yo=125.3;

xx1=[129, 129, 130, 131, 132, 133, 135, 136, 135, 134, 130, 124];
yy1=[111, 110, 109, 110, 110, 112, 115, 118, 120, 124, 129, 122];

xx2=[128, 129, 130, 131, 132, 133, 135, 135, 135, 134, 131, 124];
yy2=[111, 110, 110, 110, 110, 112, 115, 118, 120, 124, 128, 122];

xx3=[128.0, 128.2, 129.9, 131.0, 133.0, 134.0, 135.3, 135.5, 134.5, 134.0, 130.4, 123.9];
yy3=[112.3, 110.2, 110.1, 110.0, 111.5, 113.4, 114.7, 118.0, 120.3, 123.5, 128.6, 122.0];

xx4=[127,128.5,129.7,130.9,131.9,133.7,134,135.7,135,133.9,130.5,124.2];
yy4=[111,111,110.3,110.5,111.4,112.3,114,116.9,119,123.7,128.3,122.4];

tim=[1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2002.9];

x1=0.25*(xx1+xx2+xx3+xx4)-xo;
y1=0.25*(yy1+yy2+yy3+yy4)-yo;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

No=length(tim);
set(gca,'Ydir','Reverse');

figure(1)
plot(tim,xx1-xo,'+b',tim,xx2-xo,'+b',tim,xx3-xo,'+b',tim,xx4-xo,'+b',tim,x1,'or');
title('check the data of xx for large discrepancies')
xlabel('time (year)')
ylabel('\Delta x')
hold off

figure(2)
plot(tim,yy1-yo,'+b',tim,yy2-yo,'+b',tim,yy3-yo,'+b',tim,yy4-yo,'+b',tim,y1,'or')
title('check the data of yy for large discrepancies')
xlabel('time (year)')
ylabel('\Delta y')
hold off


% THE x1,y1, and tim arrays are stored in test.mat file
DAT=[x1;y1;tim];
 save( 'DATAfile.mat', 'DAT');
 
 
 
% A = fscanf(test.mat,formatSpec)

