Skip to content

MATLAB helper functions to handle Python-to-MATLAB and MATLAB-to-Python object transformations. It can handle Numpy and Pandas objects

Notifications You must be signed in to change notification settings

lopezco/matlab_python_tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

MATLAB functions to run Python code

Configuration

In order to use MATLAB functions, please add the folder matlab_python_tools to the MATLAB path using the pathtool function in the console.

pathtool

This will open a new window. Click on "Add folder...", browse and select the folder matlab_python_tools.

Select Python interpreter

The function pythontools.env.activate can be used to select the Python interpreter.

pythontools.env.activate('environments_folder', 'pylidarcheck')

Then you can call any Python function through the py variable.

Examples

To create a Python list can use the following code:

>> myList = py.list([1,2,3,4]);

myList =

  Python list with no properties.

    [1.0, 2.0, 3.0, 4.0]

You can also call functions from other modules. For example:

>> myPath = 'path_to__a_file/filename.txt'

myPath =

    'path_to__a_file/filename.txt'

>> py.os.path.basename(myPath)

  Python str with no properties.

    filename.txt

About

MATLAB helper functions to handle Python-to-MATLAB and MATLAB-to-Python object transformations. It can handle Numpy and Pandas objects

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages