pyrunfile
Syntax
Description
pyrunfile( executes the Python statements with input arguments. Python scripts read command-line arguments as strings.file input)
executes the code with one or more name-value pair arguments.outvars = pyrunfile(file,outputs,pyName=pyValue)
Examples
Input Arguments
Output Arguments
Limitations
Python classes defined using
pyrunorpyrunfilecannot be modified if you return an instance of the class to MATLAB. If you need to change class definitions, restart the interpreter session:terminate(pyenv) pyenv(ExecutionMode="OutOfProcess")
Alternatively, restart MATLAB for in-process execution mode.
The
pyrunandpyrunfilefunctions do not support classes with local variables that are initialized by other local variables through methods. For such usage, create a Python module and access it using thepy.prefix.Type conversion based on Python type hints is not supported for
pyrun,pyrunfile, or the Run Python Code task, where you provide native Python code as input.
Version History
Introduced in R2021b