clear;

ser = input('Please input series number:  ');
%drc = ['../check_ea/out_', ser, '/'];
%drc = ['../../exp_IMAEAfm/check_ea/out_', ser, '/'];
%drc = ['../../exp_ESA_S1fm/check_ea/out_', ser, '/'];
%drc = ['../../exp_ESA_S2fm/check_ea/out_', ser, '/'];
drc = ['../../exp_IEAfm/check_ea/out_', ser, '/'];

%fnm = dir(drc);
%[num, nn] = size(fnm);

%drcc = ['../check_ea/out_', ser, '/VX000*'];
%drcc = ['../../exp_IMAEAfm/check_ea/out_', ser, '/'];
%drcc = ['../../exp_ESA_S2fm/check_ea/out_', ser, '/VX030*'];
fnm = dir(drc);
[num, nn] = size(fnm);

j=0;
for i = 3:2:num-1
%for i = 1:2:num-1
    dat_fnm = fnm(i).name;
    lbl_fnm = fnm(i+1).name;
    %tmp_fnm((i+1)/2,:) = fnm(i+1).name;
    ave_e((i+1)/2,1) = plot_ea_sub3(drc, lbl_fnm);
    ave_e((i+1)/2,2) = j;
    j = j +2;
    %ans = input('Will you see next Ea?  1/0 (yes/no)');
    %if ans ‾= 1 
    %    return
    %end
end

plot(ave_e(:,1), 'rs','MarkerSize',4);
grid on;
xlabel('VX (deg)');
ylabel('Energy(%)');

