files = {'LambdaVar/comp1.txt','LambdaVar/comp2.txt','LambdaVar/comp3.txt','LambdaVar/comp4.txt',... 'LambdaVar/comp5.txt','LambdaVar/comp6.txt','LambdaVar/comp7.txt', 'LambdaVar/comp8.txt', ... 'LambdaVar/comp9.txt', 'LambdaVar/comp10.txt'}; max_syn8 = 0; max_syn20 = 0; max_syn47 = 0; max_full47 = 0; nbr_files = size(files,2); for file_idx = 1 : nbr_files file = files{file_idx}; f = fopen(file); miters = 350; x = 1:miters; Syn = zeros(miters,1); for i = 1 : miters line = fgets(f); line= strsplit(line); num = strrep(line{7}, ')', ''); iter = str2double(num); if iter ~= 1 || i == 1 Syn(i,1) = iter; else break; end end Syn1 = zeros(miters,1); Syn1(1,1) = 1; for i = 2 : miters line = fgets(f); line= strsplit(line); num = strrep(line{7}, ')', ''); iter = str2double(num); if iter ~= 1 Syn1(i,1) = iter; else break; end end Syn2 = zeros(miters,1); Syn2(1,1) = 1; for i = 2 : miters line = fgets(f); line= strsplit(line); num = strrep(line{7}, ')', ''); iter = str2double(num); if iter ~= 1 Syn2(i,1) = iter; else break; end end Full = zeros(miters,1); Full(1,1) = 1; for i = 2 : miters if ~feof(f) line = fgets(f); line= strsplit(line); num = strrep(line{7}, ')', ''); iter = str2double(num); Full(i,1) = iter; end end fclose(f); width = 3; height = 3; alw = 2.75; fsz = 24; lw = 2.5; msz = 8; file2 = strrep(file, '.txt', ''); max_syn8 = max_syn8 + max(Syn) * 8; max_syn20 = max_syn20 + max(Syn1) * 20; max_syn47 = max_syn47 + max(Syn2) * 47; max_full47 = max_full47 + max(Full) * 47; end f = [max_syn8, max_syn20, max_syn47, max_full47]; f = f/nbr_files; bar(f, 'FaceColor', [0.75 0.75 0.75]); box off; set(gca, 'xticklabels', {'8', '20', '47 Syn', '47'}, 'FontSize', fsz, 'LineWidth', lw) xlabel('Number of Controlled Variables') ylabel('Number of Samples')