Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Bacterial growth in a colony
- clc;
- close;
- %input intital data
- no = input('Enter the initial bacterial count: ');
- t = input('Enter the elapsed time in hours: ');
- for time = 0:1:t
- n = no*exp(1.386*time);
- s = sprintf('time: %d hr --> bacteria count: %0.0f', time, n);
- disp(s);
- end
- %plot the data
- time = 0:0.1:t;
- n = no*exp(1.386*time);
- plot(time, n);
- grid;
- title('Exponetial Growth of Bacteria');
- xlabel('Time (hours)');
- ylabel('Bacterial Count');
Advertisement