Download MATLAB Compiler

Transcript
3
MATLAB® Code Deployment
Write Deployable MATLAB Code
In this section...
“Compiled Applications Do Not Process MATLAB Files at Runtime” on
page 3-12
“Do Not Rely on Changing Directory or Path to Control the Execution of
MATLAB Files” on page 3-13
“Use ismcc and isdeployed Functions To Execute Deployment-Specific Code
Paths” on page 3-14
“Gradually Refactor Applications That Depend on Noncompilable
Functions” on page 3-14
“Do Not Create or Use Nonconstant Static State Variables” on page 3-15
“Get Proper Licenses for Toolbox Functionality You Want to Deploy” on
page 3-15
Compiled Applications Do Not Process MATLAB Files
at Runtime
MATLAB Compiler secures your code against unauthorized changes.
Deployable MATLAB files are suspended or frozen at the time MATLAB
Compiler encrypts them—they do not change from that point onward. This
does not mean that you cannot deploy a flexible application—it means that
you must design your application with flexibility in mind. If you want the end
user to be able to choose between two different methods, for example, both
methods must be available in the built component.
The MCR only works on MATLAB code that was encrypted when the
component was built. Any function or process that dynamically generates
new MATLAB code will not work against the MCR.
Some MATLAB toolboxes, such as the Neural Network Toolbox™ product,
generate MATLAB code dynamically. Because the MCR only executes
encrypted MATLAB files, and the Neural Network Toolbox generates
unencrypted MATLAB files, some functions in the Neural Network Toolbox
cannot be deployed.
3-12