
clear				% Clear previous definitions
figure(1)           % Assign figure number
clf                 % Clear previous figures
hold off            % Start with fresh graph

mytitle = 'Euler''s Method - Malthusian Growth'; 	% Title
xlab = '$t$'; 		% X-label
ylab = '$P(t)$'; 		% Y-label

tt = linspace(0,10,200);
yy = 50*exp(0.2*tt);
[t,y]=euler(@pop,0.5,0,10,50);
plot(tt,yy,'b-','LineWidth',1.5);  % Plot concentration of pollution
hold on                            % Plots Multiple graphs
plot(t,y,'r-o','LineWidth',1.5,'MarkerSize',7);  % Plot when reaches critical level
grid                                % Adds Gridlines
legend('Actual Solution','Euler Solution','Location','Southeast');
xlim([0 10]);    % Defines limits of graph
ylim([0 400]);   % Defines limits of graph

fontlabs = 'Times New Roman';   % Font type used in labels
xlabel(xlab,'FontSize',14,'FontName',fontlabs,'interpreter','latex');  
        % x-Label size and font
ylabel(ylab,'FontSize',14,'FontName',fontlabs,'interpreter','latex');  
        % y-Label size and font
title(mytitle,'FontSize',16,'FontName','Times New Roman','interpreter','latex'); 
        % Title size/font
set(gca,'FontSize',12);         % Axis tick font size

print -depsc pop_eul.eps		% Create figure as EPS file
%print -djpeg lake2.jpg		% Create figure as JPEG file

