The MATLAB®
Production Server™ Python client API enables
developers to evaluate MATLAB functions on remote servers. The
API lets you pass scalar values to a MATLAB function using native Python types.
When working with arrays, you need to use the MATLAB array types
provided in the matlab
package. For information
on using MATLAB arrays in Python, see MATLAB Arrays as Python Variables.
For an overview of how to create client programs, see Create a MATLAB Production Server Python Client.
For a complete example of a client implementation, see Create a Python Client.
matlab.production_server.client.MWHttpClient | Python object encapsulating a connection to a MATLAB Production Server instance |
Install the MATLAB Production Server Python Client
Install the packages required to use the Python client
Create a MATLAB Production Server Python Client
To create a MATLAB Production Server client:
Create a connection from a Python client to a MATLAB Production Server instance
This example shows how to use MATLAB arrays in Python.
Invoke MATLAB Functions that Return Zero Outputs
Create calls to functions that return no output
Invoke MATLAB Functions that Return a Single Output
Create calls to functions that return one result
Invoke MATLAB Functions that Return Multiple Outputs
Create calls to functions that return two, or more, results
Handle Function Processing Errors
Catch and process errors returned from the server
Pass Data to MATLAB Production Server from Python
When you pass data as input arguments to MATLAB functions from Python, MATLAB Production Server converts the data into equivalent MATLAB data types.
Handle Data Returned from MATLAB Production Server to Python
When MATLAB functions return output arguments, MATLAB Production Server converts the data into equivalent Python data types.
MATLAB Arrays as Python Variables
Python representation of MATLAB data types