In this article the MATLAB scripts provided by Xsens to read MVNX files are described.
1. Download the MATLAB scripts
Go to our website (https://www.xsens.com/). Go to Support -> Downloads -> MVN Analyze ->Tools, and download the "Developer toolkit"
After you download you can find the MARLAB scripts in:
C:\Program Files\Xsens\Xsens MVN Developer Toolkit X.X.X\Matlab
2. Description of the files
In the provided package you can find two matlab files:
The file that you need to run to get the data out of your mvnx file is the main_mvnx_v2.mat. The load_mvnx_v2.mat is a matlab function created to gather the data in the mvnx file into a tree structure in MATLAB.
3. First steps
- In the MVN software you need to export your file in MVNX format. Please make sure that when exporting the file, all the parameters of interest are checked and that the desire frame rate is correct.
- After exporting the mvnx file, place the MATLAB files in the same folder as the mvnx file that you would like to import in MATLAB.
- Open the main_mvnx_v2.mat file in MATLAB.
- Change the file name in the entry of the function load_mvnx_v2(filename); for the name of your mvnx file (example: load_mvnx_v2('Run and Jump.mvnx');).
4. Tree Structure
After running the main_mvnx_v2 script, a matlab structure with all the data from the mvnx file is generated. Below this structure is detailed described.
|Tree||metaData||Information about the file storage, software and recording settings.|
|segmentData||Data for each of the segments defined in the biomechanical model.|
|sensorData||Raw data from each of the sensors used in the recording.|
|jointData||Data for each of the joints defined in the biomechanical model.|
|ergonomicJoints||Data for each of the ergonomic joints available for the selected model.|
|footContact||Binary structure defining if contact of the foot or toe were detected.|
|frame||Data about the time of the recording and position of the Center of Mass|
To further understand exactly the content of each category please read the MVNX format article: https://base.xsens.com/hc/en-us/articles/360012672099.