Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB Compiler   

Dependency Analysis Function (depfun) and User Interaction with the Compilation Path

addpath and rmpath in MATLAB

If you run MATLAB Compiler from the MATLAB prompt, you can use the addpath and rmpath commands to modify the MATLAB path before doing a compilation. There are two disadvantages:

Passing -I <directory> on the Command Line

You can use the -I option to add a folder to the beginning of the list of paths to use for the current compilation. This feature is useful when you are compiling files that are in folders currently not on the MATLAB path.

Passing -N and -p <directory> on the Command Line

There are two MATLAB Compiler options that provide more detailed manipulation of the path. This feature acts like a "filter" applied to the MATLAB path for a given compilation. The first option is -N. Passing -N on the mcc command line effectively clears the path of all folders except the following core folders (this list is subject to change over time):

It also retains all subfolders of the above list that appear on the MATLAB path at compile time. Including -N on the command line allows you to replace folders from the original path, while retaining the relative ordering of the included folders. All subfolders of the included folders that appear on the original path are also included. In addition, the -N option retains all folders that the user has included on the path that are not under matlabroot/toolbox.

Use the -p option to add a folder to the compilation path in an order-sensitive context, i.e., the same order in which they are found on your MATLAB path. The syntax is

p <directory>

where <directory> is the folder to be included. If <directory> is not an absolute path, it is assumed to be under the current working folder. The rules for how these folders are included are

  


Free MATLAB Compiler Interactive Kit

Learn how to build standalone executables and C/C++ shared libraries from MATLAB code.


Get free kit

Trials Available

Try the latest version of MATLAB Compiler.


Get trial software
 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS