file = 'comp0.txt'; f = fopen(file); miters = 100; x = 1:miters; Syn = zeros(miters,1); for i = 1 : miters line = fgets(f); line= strsplit(line); Syn(i,1) = str2num(line{3}); end Full = zeros(miters,1); for i = 1 : miters line = fgets(f); line= strsplit(line); Full(i,1) = str2num(line{3}); end fclose(f); width = 3; height = 3; alw = 2.75; fsz = 24; lw = 2.5; msz = 8; semilogy(x, Syn, x, Full,'LineWidth', 4.5, 'MarkerSize', msz); xlabel('Iteration number'); ylabel('Cost Function Value'); xlim([1, miters]) legend('8 Synergies', 'Full') legend boxoff; box off; set(gca, 'FontSize', fsz, 'LineWidth', lw) file2 = strrep(file, '.txt', '');