Question
A type of pathogenic bacteria in a lake, under optimal conditions, double their number (growth rate of ) every 20 hours. In general, starting with
A type of pathogenic bacteria in a lake, under optimal conditions, double their number (growth rate of ) every 20 hours. In general, starting with bacteria at time 0, there are bacteria after 20 hours, bacteria after 40 hours, and so on. For this particular type of pathogenic bacteria and lake, the lake is not safe to swim in if the bacteria population density exceeds bacteria per ml. Write a MATLAB function that will determine how long it will take for an initial pathogenic bacteria level per ml to reach an unsafe level of n = 1 x per ml. function y = myFunction(n0, r) The function should get the initial pathogenic bacteria level (number per ml) and the growth rate r as the parameters and return the time in days it takes the bacteria population density to reach or exceed the unsafe level of n = 1 x per ml. Assign the result to output y. For example, an initial bacterial level of = 100 per ml would reach an unsafe level in a little under 6 days.
function y = myFunction(n0, r) % find out number of days needed to reach to an unhealtht level and assign it to the output y. end
n0=100 r=1 days = myFunction(n0,r)
hours, and so on. For this particular type of pathogenic bacteria and lake, the lake is not safe to swim in if the bacteria population density exceeds 104 bacteria per ml. Write a MATLAB function that will determine how long it will take for an initial pathogenic bacteria level n0 per ml to reach an unsafe level of n=1x104 per ml. function y= myFunction(no, r) the result to output y. For example, an initial bacterial level of n0=100 per ml would reach an unsafe level in a little under 6 days. Function 0 1 function y=myFunction(n,r) \% find out number of days needed to reach to an unhealtht level and assign it to the output y. Code to call your function (
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started