Runge kutta 4 with matrix

4 views (last 30 days)
Mark Johnson
Mark Johnson on 17 Apr 2015
Commented: James Tursa on 17 Apr 2015
Hello!
I have tried to search but can't find any good answers for my questions.
I have a matrix 2xN with x-values on the first row and y-values on the second row. N depends on how many steps I want to make using my program.
Now I want to use runge kutta 4 to on this matrix to calculate the answer. I've used the formula on paper and so on but can't figure out how to use it in matlab with a matrix. And no, I don't want to use ode45, only as a reference.
Thanks!
  1 Comment
James Tursa
James Tursa on 17 Apr 2015
You haven't said what x and y are, or what your differential equations are. So we can't advise you on how to set up the MATLAB code. Also, are you coding up an RK4 manually for some reason rather than using ode45?

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!