%-------------------------------------% % Exercise 7: Bacterial Growth % % Date: 10/22/2002 % % % % Gun Srijuntongsiri % % gs61 % % ?????? % %-------------------------------------% % Important variables % ------------------- % a = number of bacteria in Medium A at each 3 hour interval % b = number of bacteria in Medium B at each 3 hour interval % x = label of x-axis, i.e. time. a(1) = 1; b(1) = 1; x = 0:3:24; % Calculate the number of bacteria for each 3 hour interval... for i=2:9 a(i) = a(i-1)*8; b(i) = b(i-1)*4; end % Plot the result close all % Close previous figures plot(x,a,x,b) xlabel('time (hr)'); ylabel('# of bacteria'); title('xy plot of # of bacteria in mediums after 24 hours'); legend('Medium A','Medium B'); figure semilogy(x,a,x,b) xlabel('time (hr)'); ylabel('# of bacteria'); title('linear-log plot of # of bacteria in mediums after 24 hours'); legend('Medium A','Medium B'); %% After 24 hours, number of bacteria in Medium A is much higher %% than that in Medium B.