Manipulator inertia matrix
I = inertia(R,Q)
I = inertia(R,Q) is the symmetric joint inertia matrix (NxN) which relates joint torque to joint acceleration for the robot at joint configuration Q.
If Q is a matrix (KxN), each row is interpretted as a joint state vector, and the result is a 3d-matrix (NxNxK) where each plane corresponds to the inertia for the corresponding row of Q.
The diagonal elements I(J,J) are the inertia seen by joint actuator J.
The off-diagonal elements I(J,K) are coupling inertias that relate acceleration on joint J to force/torque on joint K.
The diagonal terms include the motor inertia reflected through the gear ratio.