Pypath

get_py_path()[source]

Function to return the current python search path as a cell array of strings

py_addpath(directory, MATLAB_too)[source]

Add directory to import search path for the instance of the Python interpreter currently controlled by MATLAB

EXAMPLE USAGE

>> py_addpath(‘C:DocumentsERPResults’)

REQUIRED INPUTS

directory - Directory to add the Python import search path MATLAB_too - If true (or 1), directory will also be added to the

MATLAB path. {default: false}

OPTIONAL OUTPUT
new_py_path - a cell array of the directories on the updated

Python path; to get this output without updating the Python path, use an empty string as the input: py_path = py_addpath(‘’)

VERSION DATE: 3 Novemeber 2017 AUTHOR: Eric Fields

NOTE: This function is provided “as is” and any express or implied warranties are disclaimed.

py_rmpath(directory, MATLAB_too)[source]

Add directory to import search path for the instance of the Python interpreter currently controlled by MATLAB

EXAMPLE USAGE

>> py_rmpath(‘C:DocumentsERPResults’)

REQUIRED INPUTS

directory - Directory to remove from the Python import search path MATLAB_too - If true (or 1), directory will also be added to the

MATLAB path. {default: false}

OPTIONAL OUTPUT
new_py_path - a cell array of the directories on the updated

Python path; to get this output without updating the Python path, use an empty string as the input: py_path = py_addpath(‘’)

VERSION DATE: 13 April 2021 AUTHOR: Ronan Fleming, based on py_addpath by Eric Fields

NOTE: This function is provided “as is” and any express or implied warranties are disclaimed.