Hi all,
I need help solving the logistic growth model (an ODE) using Euler's Method in MATLAB.
The function is: (dy/dx) = r*y*(1-(y/K)) where r is the growth rate and K is the carrying capacity.
I have solved this out by hand but I am having a difficult time implementing it as a function.
I'm meant to write a function with two inputs (a vector time, t, and an initial y, y0) and this function is meant to output a vector of solutions to the ode for each time t and plot the results.
I know there is mean to be some h as a time step to evaluate a new tangent line at the function and the smaller that step is, the more accurate the answer is, but I'm having a hard time writing the code.
Can anyone help?
Best Answer