BodyMech functions adjusted for MATLAB R2013