How to read and write .nex and .nex5 files in Matlab, Python, C++ and C#
.nex and .nex5 files are binary files with the following general structure:
File header (number of variables in file (N), etc.)
Variable1 header (variable name, number of values, etc.)
Variable2 header (variable name, number of values, etc.)
…
VariableN header (variable name, number of values, etc.)
Variable1 data (timestamps, continuous values, etc.)
Variable2 data (timestamps, continuous values, etc.)
…
VariableN data (timestamps, continuous values, etc.)
The code to read and write .nex and .nex5 files is available in the following zip files:
File Name |
Description |
---|---|
Matlab code to read and write .nex and .nex5 files |
|
Old Python code to read and write .nex and .nex5 files. See also nex5file Python package documentation |
|
C++ code to read and write .nex files |
|
C++ code to read and write .nex5 files |
|
C# code to read and write .nex and .nex5 files |
README.txt file in each of these zip files contains instructions on how to use the code.