I'm trying to solve differential equation using the ode45
function. Consider the following code,
[t1,X2] = ode45(@(t,x)fun(t,x,C1,C2,C3,C4),t0,X01);
where parameters C1
, C2
, C3
and C4
are column vectors, which should be available to the function that ode45
is referring to (fun.m
). I want the values to change after every iteration, so for example, at the beginning the entry of C1
I want in is C1(1)
, in the next iteration it's C1(2)
, etc.
How can I implement that?