Thanks for the question.
To help you with the conversion, MATLAB has a built in function to go from quaternion to euler angle but I am also putting code below to do this conversion:
double m00 = 1.0 - 2.0*qy*qy - 2.0*qz*qz;
double m01 = 2.0*qx*qy + 2.0*qz*qw;
double m02 = 2.0*qx*qz - 2.0*qy*qw;
double m10 = 2.0*qx*qy - 2.0*qz*qw;
double m11 = 1 - 2.0*qx*qx - 2.0*qz*qz;
double m12 = 2.0*qy*qz + 2.0*qx*qw;
double m20 = 2.0*qx*qz + 2.0*qy*qw;
double m21 = 2.0*qy*qz - 2.0*qx*qw;
double m22 = 1.0 - 2.0*qx*qx - 2.0*qy*qy;
double R = atan2(m12, m22);
double c2 = sqrt(m00*m00 + m01*m01);
double P = atan2(-m02, c2);
double s1 = sin(R);
double c1 = cos(R);
double Y = atan2(s1*m20 - c1*m10, c1*m11-s1*m21);
qw, qx, qy, and qz are the 4 values of a quaternion. The 'm' variables are actually entries in a 4x4 transformation matrix but we aren't using the whole matrix so I only calculate some of them to then be used to generate R, P, and Y which are
Roll,
Pitch, and Yaw respectively.