Dependency Analysis Using MATLAB Compiler
Compiler™ uses a dependency analysis function to determine the list of necessary files
to include in the generated package. Sometimes, this process generates a large list of
files, particularly when MATLAB object classes exist in the compilation and the dependency analyzer cannot
resolve overloaded methods at package time. Dependency analysis also processes
exclude files on each pass.
To improve package time performance and lessen application size, prune the path with
flags. You can also specify Files required for your application to
run in the compiler app or use the
option in a
The dependency analyzer searches for executable content such as:
If the MATLAB file corresponding to the p-file is not available, the dependency analysis cannot determine the p-file’s dependencies.
Data File Dependency
In addition to executable content listed above, MATLAB
Compiler can detect and automatically include files
that your MATLAB functions access by calling
any of these functions:
To ensure that a specific file is included, specify the full path to the file as a character array in the function.
The compiler app automatically adds these data files to the Files required for your application to run area.
Exclude Files From Package
To ignore data files during dependency analysis, use one or more of the following
options. For examples on how to use these options together, see
%#excludepragma in your MATLAB code to ignore a file or function during dependency analysis.
-Xflag in your
mcccommand to ignore all data files detected during dependency analysis.
AutoDetectDataFilesoption in a
compiler.buildfunction to control whether data files are automatically included in the package. Setting this to
0is equivalent to using