inpystem.tools.matlab_interface module

This module defines an interface to run matlab codes from python.

inpystem.tools.matlab_interface.matlab_interface(program, dataDico)

Interfaces a matlab code with python3.

The functions needs a matlab program to run and input data to be given to the matlab program.

The input data should be given in dictionary format where keys are the matlab variable names and values are the variable data.

Parameters
  • program (str, Path object) – The program path.

  • dataDico (dict) – The dico containing the data to give to the program.

Returns

The data returned by the program.

Return type

dict

Note

A matlab command matlab should be accessible in the command line to make this code work.

If this does not work, please be sure the PATH variable is perfecty set. For exemple, please add this to your .bashrc for Linux Users:

.bashrc
  export PATH:$PATH:/path/to/matlab/bin

and for Windows users, please have a search about how to add a location into your path (this is a graphical task).