I want to compute the solution of a first order differentiable equation using ode45 in MATLAB.
But I want to compute the solution in precise times and knowing a input variable in those instants.
Let t be the vector with n time instants where I want to compute the solution, and u the input vector also with n values, where $u(k)$ is the value of $u$ at instant $k$, and $k$ belong to $t$.
I call the ode45 function as:
[t,T_dot]=ode45(@f_mass,t,.01,odeset,u);
and f_mass is:
function T_dot=f_mass(t,T,u)
T_dot=(1-u)*T;
end
How can I specify that u is u(t)?
Thanks