Test if code is running during compilation process (using
x = ismcc
x = ismcc returns true when the function is being executed by
mcc dependency checker and false otherwise.
When this function is executed by the compilation process started by
mcc that runs outside of MATLAB® in a system command prompt, it will return true. This function will return
false when executed within MATLAB as well as in deployed mode. To test for deployed mode execution, use
isdeployed. This function must be used in
hgrc (or any function called
within them, for example
startup.m) to guard code from being executed
mcc) or MATLAB
In a typical example, a user has
ADDPATH calls in their
MATLAB code. These can be guarded from executing using
during the compilation process and
isdeployed for the deployed
startup.m, as shown in the example on this page.
`% startup.m if ~(ismcc || isdeployed) addpath(fullfile(matlabroot,'work')); end
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
Returns true and false as appropriate for MEX and SIM targets.
Returns false for other targets.