Main Content

MATLAB Runtime User Data Interface

This feature allows data to be shared between a MATLAB® Runtime instance, the MATLAB code running on that MATLAB Runtime instance, and the wrapper code that created the MATLAB Runtime instance. Through calls to the MATLAB Runtime User Data interface API, you access MATLAB Runtime data by creating a per-instance associative array of mxArrays, consisting of a mapping from string keys to mxArray values. Reasons for doing this include, but are not limited to:

  • You need to supply MATLAB Runtime profile information to a client running an application created with the Parallel Computing Toolbox™ software. Profiles may be supplied (and changed) on a per-execution basis. For example, two instances of the same application may run simultaneously with different profiles.

  • You want to initialize MATLAB Runtime with constant values that can be accessed by all your MATLAB applications.

  • You want to set up a global workspace — a global variable or variables that MATLAB and your client can access.

  • You want to store the state of any variable or group of variables.

MATLAB Compiler SDK™ software supports a per-MATLAB Runtime instance state access through an object-oriented API. Access to a per-instance state is optional. You can access this state by adding setmcruserdata.m and getmcruserdata.m to your deployment project or by specifying them on the command line. Alternatively, you can use a helper function to call these methods as shown in Specify Parallel Computing Toolbox Profile in .NET Application.

For more information, see Using MATLAB Runtime User Data Interface.