MATLAB Answers

0

access to element of variable in ode

Asked by siroos jalilyan on 16 Sep 2018
Latest activity Commented on by siroos jalilyan on 17 Sep 2018
function V=wffun(t,i)
[t,i] = ode15s(@wffun,tspan,i0)
ode return Matrix with length of k. how can i access element of t and i while ode is runing? in function wffun i use t(k-1) and t(k)

  0 Comments

Sign in to comment.

1 Answer

Answer by Steven Lord
on 17 Sep 2018

If the differential equation you're solving includes a reference to the value of a component of the solution at an earlier time, you don't have an ordinary differential equation. Use a delay differential equation solver instead.

  1 Comment

No just i need value of "t" in previous step and current step in function wffun if use "t" just return one value .

Sign in to comment.