I have an equation:
where t and v(t) are known. I have to find u(t).
I wrote a program:
function dudt = odefcn(t, u, v)
dudt = v.^2 * u + v .* u + diff(v);
end
[t,u] = ode45(@(t,u) odefcn(t,u,v), tspan, u0);
The problem is that the function v(t) is a vector that has the same dimension as t. Finally, I see the error that dimensions do not match.
