项目作者: lopezco

项目描述 :
MATLAB helper functions to handle Python-to-MATLAB and MATLAB-to-Python object transformations. It can handle Numpy and Pandas objects
高级语言: MATLAB
项目地址: git://github.com/lopezco/matlab_python_tools.git
创建时间: 2019-05-09T09:43:57Z
项目社区:https://github.com/lopezco/matlab_python_tools

开源协议:

下载


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.

  1. 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.

  1. 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:

  1. >> myList = py.list([1,2,3,4]);
  2. myList =
  3. Python list with no properties.
  4. [1.0, 2.0, 3.0, 4.0]

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

  1. >> myPath = 'path_to__a_file/filename.txt'
  2. myPath =
  3. 'path_to__a_file/filename.txt'
  4. >> py.os.path.basename(myPath)
  5. Python str with no properties.
  6. filename.txt