a=1;
b=1.2;

x=0.1:0.1:5;

%for n=1:5:101
%for ind=0:1
 p=zeros(50,1);
fid=fopen('data.txt','w');
 for p=1:1:50
  y(p,1)=thr(p/10,a,b,1,0);
  fprintf(fid,'%f %f \n', p/10, y(p,1));
 end
fclose (fid);
 hold on
 xlabel ('Inter-period (sec)', 'FontSize', 22);
 ylabel ('Throughput (norm.)', 'FontSize', 22);
 plot(x,y)
     print -dps fig.ps;
%end
%end
