# Using Runge-Kutta in Matlab

13 views (last 30 days)

Show older comments

##### 0 Comments

### Accepted Answer

Bruno Luong
on 23 Aug 2023

Edited: Bruno Luong
on 23 Aug 2023

" I can calculate an arbitrary velocity f(x,t) from the forces acting on a position x."

Good this is a very good starting point. If you have f(x,t) in MATLAB function form,

then simply call

sol = ode45(@(t,x) f(x,t), [t0 tend], x0)

tend is the last time where you want the solution to be computed.

Read the doc of ode45

##### 8 Comments

### More Answers (0)

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!