Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB Builder JA   

Using MCR Component Cache and MWComponentOptions

MWComponentOptions

As of R2007b, CTF data is now automatically extracted directly from the JAR file with no separate CTF or componentname­mcr folder needed on the target machine. This behavior is helpful when storage space on a file system is limited.

If you don't want to use this feature, use the MWComponentOptions class to specify how the MATLAB Builder JA product handles CTF data extraction and utilization.

Selecting Options

Choose from the following CtfSource or ExtractLocation instantiation options to customize how the MATLAB Builder JA product manages CTF content with MWComponentOptions:

Setting Options

Use the following methods to get or set the location where the CTF archive may be found for an extracted component:

Use the following methods to get or set the location where the extracted CTF content is to be located:

Example: Enabling MCR Component Cache, Utilizing CTF Content Already on Your System

If you want to enable the MCR Component Cache for a Java component (in this example, using the user-built Java class MyModel) utilizing CTF content already resident in your file system, instantiate MWComponentOptions using the following statements:

MWComponentOptions options = new MWComponentOptions();

// set options for the component by calling setter methods
// on ‘options'
options.setCtfSource(MWCtfSource.NONE);
  options.setExtractLocation(
    new MWCtfExtractLocation("C:\\readonlydir\\MyModel_mcr"));

// instantiate the component using the desired options 
MyModel m = new MyModel(options);
  


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