MATLAB: Solving differential equation containing independent function

differential equationsode45

Hi, I am trying to solve a differential equation of the form:
y_dot = f-5y
where f is a function stored as an array with values corresponding to each instant within the integration time interval. From what I know, this is not an ode and can't be solved using the built in ode solvers. Is there a way to solve this differential equation in MATLAB. Thank you!

Best Answer

The example
"ODE with Time-Dependent Terms"
under
https://de.mathworks.com/help/matlab/ref/ode45.html
shows you how to proceed.
Best wishes
Torsten.
Related Question