clear				% Clear previous definitions
figure(2)           % Assign figure number
clf                 % Clear previous figures
hold off            % Start with fresh graph
mytitle = '\it Escherichia coli'; 	
xlab = '$t$ (min)'; 	
ylab = '$P_n$ (OD$_{420}$)'; 
td = [0	20	40	60	80	100	120	140	160];
pd = [0.195 0.206 0.241 0.308 0.364 0.421 0.473 0.527 0.618];
[p1,J,flag] = fminsearch(@ec_disc_lst,[0.2,0.15],[],td,pd)
N = length(td);
p = p1(1);
pop = [p];
for i = 2:N+1  % Malthusian iteration
    p = p*(1+p1(2));
    pop = [pop,p];
end   
plot([td,180],pop,'ro-','LineWidth',1.5);  
hold on   
plot(td,pd,'bo','LineWidth',1.5); 
grid 
myeqn=['$P_{n+1} = (1+',num2str(p1(2)), ')P_n,\quad P_0 =$', num2str(p1(1))];
text(37,0.63,myeqn,'FontSize',14,'interpreter','latex');
legend('Model', 'Data','Location','southeast');
xlim([0 180]); 
ylim([0 0.8]);
fontlabs = 'Times New Roman'; 
xlabel(xlab,'FontSize',14,'FontName',fontlabs,'interpreter','latex'); 
ylabel(ylab,'FontSize',14,'FontName',fontlabs,'interpreter','latex');
title(mytitle,'FontSize',18,'FontName',fontlabs,'interpreter','latex'); 
set(gca,'FontSize',12); 
print -depsc ecoli_disc.eps	
print -djpeg ecoli_disc.jpg	
