toys/mat-parser
anjingyu 63930a3d9b chore: migrate 2024-04-14 23:20:38 +08:00
..
source chore: migrate 2024-04-14 23:20:38 +08:00
test-data chore: migrate 2024-04-14 23:20:38 +08:00
CMakeLists.txt chore: migrate 2024-04-14 23:20:38 +08:00
README.md chore: migrate 2024-04-14 23:20:38 +08:00
copy_deps.py chore: migrate 2024-04-14 23:20:38 +08:00
test.ps1 chore: migrate 2024-04-14 23:20:38 +08:00

README.md

A MAT File Parser Based on MATLAB APIs

When the version of MAT file update to v7.3, and the MathWorks closed source the file format, there are no libraries that can parse files in this format anymore, so you have to operate the MAT file via m script or the C/C++ APIs.

Configuration

Configure the user's MATLAB installation environment.

On Linux

# For bash
echo "export MATLAB_ROOT=/usr/local/MATLAB/R2018b" >> ~/.bashrc
source ~/.bashrc

# For zsh
echo "export MATLAB_ROOT=/usr/local/MATLAB/R2018b" >> ~/.zshrc
source ~/.zshrc

On Windows

  1. Right-click on Computer icon.

  2. Select Properties in the context menu, then Advanced system settings , on the Advanced tab, clickEnvironment Variables.

  3. Click New to create a new environment variable named MATLAB_ROOT, the value is the installation root directory of your MATLAB.

  4. Restart your terminal, then test the setting.

    echo %MATLAB_ROOT%
    

NOTE: On Windows, here we assume that you have installed the MinGW-w64 with correct version and append the required environment variables correctly also.

Here is what we used: MinGW-w64, CMake

The append the environment variables:

  1. MW_MINGW64_LOC points to the root directory of your MinGW-w64 after extraction.

  2. Append %MW_MINGW64_LOC%\bin into the PATH

  3. Append %MATLAB_ROOT%\bin into the PATH also, so that you can run mex directly without change directory to MATLAB's installation directory.

  4. Restart your terminal.

  5. In the terminal, run the following commands to setup the compilers for MATLAB:

    mex -setup C
    mex -setup C++
    

Build

On Linux

# Just run the shell script in the root directory of this project
admake build
cp Debug/dgns test-data

On Windows

# Just run the shell script in the root directory of this project
admake build
cp Debug/dgns.exe test-data
copy_deps.py
cd test-data
dgns.exe EgoSignal.mat