ode45 array size error
Show older comments
Hello everyone,
I have a lenghtly code but pretty much i'm only having 1 problem.
I have the following line of code:
[t,xdot] =ode45(@thetardynamics,[(k-1)*h k*h],X(:,k),options);
and whenever i run my script i get the following error:
Index in position 2 exceeds array bounds.
Error in problemSolver_4 (line 22) [t,xdot] =ode45(@thetardynamics,[(k-1)*h k*h],X(:,k),options);% [t,y] = ode45(odefun,tspan,y0,options)
I know it has to do with the size of the matrix but where exactly is it index 2? Does it mean at the output xdot or is inside the funcion that i have named as thetardynamics.
Thabks for the help
4 Comments
madhan ravi
on 8 Nov 2018
Edited: madhan ravi
on 8 Nov 2018
Upload your function thetardynamics and odefun
Kevin Brinneman
on 8 Nov 2018
Kevin Brinneman
on 8 Nov 2018
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!