MATLAB: How to represent the followind ODE system in MatLab

odeode45

Best Answer

Define ‘y’ as ‘x(1)’, ‘k’ as ‘x(2)’, and code it using those substitutions. (I coded it as a one-line anonymous function.)
Remember to include ‘a’ in the argument list, then pass a value for ‘a’ to it in your ODE solver call. See Passing Extra Parameters.
If this is not homework, I can post my solution.