function plot_read_text%(filename)

filename = 'pmax_0033_5.txt'; %%%--dic
fid = fopen(filename,'rb');

% %%% method 1 - fscan one for all
z = fscanf( fid, '%f%f%f' );
z = reshape(z,3,[]);
z = z';
x = z(:,1);
y1 = z(:,2);
y2 = z(:,3);

% % %%% method 2 - for loop
% id = fgetl(fid);
% x=[];y1=[];y2=[];
% while 1
%    if ~ischar(id) break;end   
%    content_temp=textscan(id,'%f%f%f');
%    x = [x content_temp{1}];
%    y1 = [y1 content_temp{2}];
%    y2 = [y2 content_temp{3}];
%    id = fgetl(fid);
% end

fclose(fid);
figure,
clf
%plot(x,y1,'r+','markersize',3)
plot(x,y1,'b','linewidth',1.5) %%% exp
hold on,
plot(x,y2,'r','linewidth',1.5), %%% square
legend('Exp', 'Square')
xlabel('$N$','Interpreter','LaTex')
ylabel('$P_{max}$','Interpreter','LaTex')
title('overlap=0.033; duration=5ns')
%plot(x,y2,'bo','MarkerSize',3),
grid
saveas(gcf, 'pmax_0033_5.fig','fig')
saveas(gcf, 'pmax_0033_5.png','png')