I found the rotation matrix returned by SensorManager.getRotationMatrix from link: What's the best 3D angular co-ordinate system for working with smartphone apps
The rotation matrix is:

But I cannot find the steps to reconstruct this matrix when I used the rotation matrix for each axis as specified in link: http://www.freescale.com/files/sensors/doc/app_note/AN3461.pdf
Rotation matrix for each axis

I really appreciate if anyone can show me the steps so that I can construct the above rotation matrix because I cannot find any document that shows me the steps to create this matrix.
And at the above link, there is also a matrix as following:

How can I calculate the matrix Matrix
.What does it mean?