| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB Builder NE |
| Contents | Index |
| Learn more about MATLAB Builder NE |
This feature allows data to be shared between an MCR instance, the M-code running on that MCR, and the wrapper code that created the MCR. Through calls to the MCR User Data interface API, you access MCR data by creating a per-MCR-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 run-time configuration information to a client running an application created with the Parallel Computing Toolbox™ software. Configuration information may be supplied (and changed) on a per-execution basis. For example, two instances of the same application may run simultaneously with different configuration files.
You want to initialize the MCR with constant values that can be accessed by all your M 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 Builder NE software supports a per-MCR instance state access through an object-oriented API. Unlike MATLAB Compiler, access to a per-MCR instance state is optional, rather than on by default. You can access this state by adding setmcruserdata.m and getmcruserdata.m to your deployment project or by specifying them on the command line.
For more information, seeImproving Data Access Using the MCR User Data Interface in the MATLAB Compiler User's Guide.
The following code snippets demonstrate storing and retrieving the MCR state while working with the MagicMatrix function.
Building the MagicMatrix Component
The following is an end-to-end example showing how to build, run, and work with the magicmatrix application and the MCR User Data interface API. This function retrieves the numeric matrix stored under the key MagicMatrix, adds 1 to it and stores the result back into the per-MCR instance data map, overwriting the previous value.
![]() | Using Dispose to Explicitly Free Resources | Dynamically Specifying Run-Time Options to the MCR | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |