clear;
%ser = input('Please input series number:  ');
%fname = ['../cal/', ser, '.txt'];

%2nd Integration test
%fname = '../../mmo130212/dat/MEA2.lm';
%fname = '../../mmo130308/dat/MSA_09.lm';
%fname = '../../mmo130308/dat/MSA_16.lm';
%fname = '../../mmo130309/dat/MSA_09.lm';
%fname = '../../mmo130309/dat/MSA_12.lm';
%fname = '../../mmo130311/dat/MSA_09.lm';
%fname = '../../mmo130311/dat/MSA_17.lm';

%SIf 5/14
%fname = '../../mmo130514/dat/MEA1.lm';
%fname = '../../mmo130514/dat/MEA2.lm';
%fname = '../../mmo130515/dat/MEA1_nukenai.lm';
%fname = '../../mmo130515/dat/MEA2.lm';
%fname = '../../mmo130516/dat/MEA1.lm';
%fname = '../../mmo130516/dat/MEA2.lm';

%Function-D 5/30
%fname = '../../mmo130530/dat/MEA1.lm';
%fname = '../../mmo130530/dat/MEA2.lm';
%fname = '../../mmo130530/dat/MIA.lm';

%Function-S 6/19
%fname = '../../mmo130619/dat/MEA1.lm';
%fname = '../../mmo130619/dat/MEA2.lm';

%Obs-smu 9/12-13
%fname = '../../mmo130912/dat/MEA1.lm';
%fname = '../../mmo130912/dat/MEA2.lm';
%Function-D 10/16-17S
%fname = '../../mmo131016/dat/MEA1.lm';
%fname = '../../mmo131016/dat/MEA2.lm'
%fname = '../../mmo131017/dat/MEA1.lm';
%fname = '../../mmo131017/dat/MEA2.lm';
%Function-S 12/03
%fname = '../../mmo131203/dat/mea1.lm';
%Function-S 12/09
%fname = '../../mmo131209/dat/MEA2.lm';
%fname = '../../mmo131209/dat/MEA1.lm';
%Function-S 12/20
%fname = '../../mmo131220/dat/MEA1.lm';
%fname = '../../mmo131220/dat/MEA2.lm';
%Function-S 1/6 2014
%fname = '../../mmo140106/dat/MEA1.lm';
%fname = '../../mmo140106/dat/MEA2.lm';
%Function-S 1/6 2014
%fname = '../../mmo140110/dat/MEA1.lm';
%fname = '../../mmo140110/dat/MEA2.lm';
%Function-S 1/23 2014
%fname = '../../mmo140123/dat/MEA1.lm';
%fname = '../../mmo140123/dat/MEA2.lm';


dat= dlmread(fname, ' ');
n = size(dat);
i = 1;
k = 1;
for i = 1:n(1)
    %MDPの時刻
    if dat(i, 2) == 9 & dat(i, 3) == 9 & dat(i,4) == 9 & dat(i,5) == 9
        ti = dat(i,1);
    else
        dat1(k, 1) = ti;
        dat1(k, 2) = dat(i,1);
        dat1(k, 3) = dat(i,2);
        dat1(k, 4) = dat(i,3);
        dat1(k, 5) = dat(i,4);
        dat1(k, 6) = dat(i,5);
        k = k + 1;
    end
end

fn = 6;
figure(fn);
%subplot(2,1,1);
plot(dat1(:,2), dat1(:,1)*16, 'rs','MarkerSize',4);
grid on;
%title('g-factor');
ylabel('MDPtime');
xlabel('MSAtime');
hold on
%plot([0 1e6], [0 1e6], '--');
sec = 0.
for i = 1:k-1
    if dat1(i, 3) == 3
        plot(dat1(i,2), dat1(i,1)*16, 'bs','MarkerSize',4);
    elseif dat1(i, 3) == 1
        plot(dat1(i,2), dat1(i,1)*16, 'g*','MarkerSize',4);
    end
end
hold off

figure(fn+1);
%subplot(2,1,2);
plot(dat1(:,2), dat1(:,4), 'rs','MarkerSize',4);
grid on;
%title('g-factor');
xlabel('Data Size');
xlabel('MSAtime');
hold on

sec = 0.
for i = 1:k-1
    if dat1(i, 3) == 3
        plot(dat1(i,2), dat1(i,4), 'bs','MarkerSize',4);
    elseif dat1(i, 3) == 1
        plot(dat1(i,2), dat1(i,4), 'gs','MarkerSize',4);
    end
end
hold off


