clear

IP3 = zeros(2001, 96*12);

for param_num = 6:9
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio0.01_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 1)  = loadtmp(:,col);
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio0.02_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 2)  = loadtmp(:,col);
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio0.05_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 3)  = loadtmp(:,col);
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio0.1_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 4)  = loadtmp(:,col);
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio0.2_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 5)  = loadtmp(:,col);
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio0.5_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 6)  = loadtmp(:,col);
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio2_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 7)  = loadtmp(:,col);
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio5_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 8)  = loadtmp(:,col);
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio10_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 9)  = loadtmp(:,col);
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio20_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 10)  = loadtmp(:,col);
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio50_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 11)  = loadtmp(:,col);
loadtmp = load(strcat('paramsIP3_param', int2str(param_num), '_ratio100_IP3.plot'));
[row col] = size(loadtmp);
IP3(:, (param_num - 1) * 12 + 12)  = loadtmp(:,col);
end

[peakamp, peaktime] = max(IP3);
Pamp = zeros(96, 12);
Ptime = zeros(96, 12);
for param = 1:96
    for parami = 1:12
       Pamp(param, parami) = peakamp((param-1)*12 + parami); 
       Ptime(param, parami) = ( peaktime((param-1)*12 + parami) - 501 ) / 1000; 
   end
end

save('PeakAmp_IP3.txt', 'Pamp', '-ASCII')
save('PeakTime_IP3.txt', 'Ptime', '-ASCII')
