File Exchange

image thumbnail

3D Kinematics and Inverse Dynamics

version 2.2 (733 KB) by Raphael Dumas
Computations of joint angles and displacements, moments and forces (lower / upper limb)


Updated 24 Nov 2019

View License

This toolbox contains all the Matlab functions for 3D kinematics and inverse dynamics computation applied to the lower and upper limb. The right lower (upper) limb is considered for sign conventions.
For instance, this toolbox includes functions for multibody optimisation with different joint models (noted N, S, U, and H for no model, spherical, universal and hinge models) and functions for inverse dynamics with different methods: vector and Euler angle (noted VE), homogenous matrix (noted HM), wrench and quaternion (noted WQ), generalized (i.e., natural) coordinate (noted GC).
The computations are performed avoiding loops on the sampled instants of time and, thus, require a set of custom-made functions (*_array3.m) for matrix/vector basic operations.

This toolbox also includes an example dataset (*.mat files to be loaded) for gait and manual wheelchair propulsion) and a series of demonstrations (Main_Question_*.m).

Cite As

Raphael Dumas (2020). 3D Kinematics and Inverse Dynamics (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (12)

Thank you for this toolbox. I may be missing it, but is there a function that can calculate the segment orientation from the joint position?

Thank you for providing the code and wondering how you got the position of the center of mass.


I am getting error as not enough input arguements when i am trying to run jointkinematics.m
Kindly help me how o use this toolbox.

I am using marker data and trying to write my own kinematics and kinetics code for human gait.

I am stuck in dynamics part how to write coding for inverse dynamics to find torque and power

Raphael Dumas

How to build the data structure is depending on the marker set used during motion capture, the regressions/methods used to estimate the joint centres and axes and the body segment inertial parameters.
There is no general code for that but the User Guide in the toolbox provide some information (pages 45-50).
Two exemples of the data structure (lower limb and upper limb) are also provided.

Hi Dear Raphael Dumas
How can I get the data structure? Is there any MATLAB code for me?
please answer to our question

Chuan He

Chuan He

Thank you for this masterpiece. How can I get the data structure? Is there any MATLAB code for me?

Don Carlson

Please re-upload to add demonstration .mat files for joints and segments or instructions on creating these files. The current data set seems to only contain shortcuts to a non-existent file.

I wang

Did not known, how to make structure of Joint.mat and Segment.mat

Ke Hong



Consistent variable names in Main_Question_7.m


Some issues with text character solved in headers, comments and figure labels and title


1) Added demo: Main_Question_7 (muscle and joint forces using a reduction approach)
2) Small modifications to improve compatibilty between computations (figure handles, function inputs)
3) Renamed functions: Multibody_Kinematics_Optimisation_...

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux