Assuming you have solved the set of 6 ODEs containing $\phi$, $\psi$, $\theta$ and their respective derivatives using ode45
in Matlab, you can obtain the orientation of your body frame with respect to the inertial frame by constructing the direction cosine matrix (DCM) at each time step. Here is an example code that you can use:
main.m1693 chars56 lines
Once you have the Euler angles calculated at each time step, you can use the plot3
function in Matlab to plot them in a 3D graph. Here is an example code that you can use:
main.m158 chars8 lines
This will give you a 3D graph of the Euler angles $\phi$, $\psi$, and $\theta$ as a function of time.
gistlibby LogSnag