To simulate an object thrown in 3D with drag force using ode45 in Matlab, you will need to write the governing equations of motion and use ode45 to integrate them numerically.
The equations of motion for an object with drag force in 3D can be written as:
main.m279 chars16 lines
To solve these equations using ode45, you will need to define them as a function:
main.m546 chars28 lines
Then, you can call ode45 to integrate the equations:
main.m312 chars15 lines
This will give you the position (x,y,z) and velocity (vx,vy,vz) vectors of the object at each time step. You can then plot these to visualize the trajectory of the object.
gistlibby LogSnag