Question about printing ode45 results

조회 수: 1(최근 30일)
Jaime De La Mota Sanchis
Jaime De La Mota Sanchis 2019년 11월 12일
댓글: Daniel M 2019년 11월 12일
Hello everyone. I have recieved a code in which an expression is called as [t, x]=ode45(@(t,x) example(t,x),tspan,x0); inside of it I have three vectors called u1d, u2d and u3d. I also have
I want to compare u(1) with u1d, u(2) with u2d and u(2) with u3d to see how good the interpolation is. The problem is that if I write
inside of example, infinite figures appear.
Can someone please explain to me if it is possible to plot the points of u1d and compare them with the interpolated ones at u(1)?
I have tried to construct
outside of the ode45 function but error messages appear.
Thanks for reading.
  댓글 수: 5
Daniel M
Daniel M 2019년 11월 12일
I will move it to an Answer then.

댓글을 달려면 로그인하십시오.

채택된 답변

Daniel M
Daniel M 2019년 11월 12일
You have the vectors time, and u1d (etc) outside of the ode45 call. And you also have the output t from the ode45 call. So,you can run an interpolation after calling ode45 (not inside).

추가 답변(0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by