Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB Builder EX   

Improving Data Access Using the MCR User Data Interface, COM Components, and MATLAB Builder EX

Overview

This feature provides a lightweight interface for easily accessing MCR data. It 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:

MATLAB Builder EX supports per-MCR instance state access through an object-oriented API. Unlike MATLAB Compiler, access to 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, see the MATLAB Compiler User's Guide.

Code Snippets

The following code snippets demonstrate storing and retrieving MCR state while working with the MagicMatrix function.

 MagicMatrix Function

 Building the MagicMatrix Component

 Calling setmcruserdata and getmcruserdata

  


Recommended Products

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