function Glist = SpatialInertia(G) % *** CHAPTER x: DYNAMICS OF OPEN CHAINS *** % Takes G: A list of inertia, % Returns Glist: Spatial inertia matrices Gi of the links n = size(G,1); Glist = zeros(6,6,n); for i = 1:n Glist(:,:,i) = diag(G(i,1:6)); end