MATLAB: How to exclude all unnecessary toolboxes while using MCC command in MATLAB R2012a

MATLAB

I want to reduce the size of my executable by excluding all the toolboxes that my application does not require. How do I do that using the MCC command?

Best Answer

You can use the -N flag to exclude all the toolboxes. You can include those toolboxes that are necessary for your application using the '-p' command.
For example, if your application called "Test_Application.m" requires only the Image Processing toolbox then the MCC command will look like:
mcc -mv -N -p D:\Applications\MATLAB\R2012a\toolbox\images Test_Application.m