Is there a convenient way to compile my application using the MATLAB Compiler when my project involves numerous MATLAB files?

9 views (last 30 days)
I have an application that involves numerous MATLAB files and I would like to deploy these using the MATLAB Compiler. It is inconvenient to specify all the file names to the MCC command everytime I want to compile. I would like a convenient way to build my project.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jan 2010
Passing all the required file arguments to the MCC command cannot be avoided. However, you can create an MATLAB file to manage these arguments. For example:
function makeProject
% cell array of file names
inputFiles = {'file1.m', ...
'file2.m', ...
% functional form of the MCC command
mcc('-m', inputFiles{:});
Then simply execute the makeProject.m file from the MATLAB command prompt to build the stand-alone application.
Note that the above function makes use of the fact that extracting multiple elements of a cell array is equivalent to a comma-separated list.
For more information on this form of indexing, copy the following to the MATLAB command prompt:
Also note that, in general, it is not necessary to supply all user-generated MATLAB files that are part of a project to the MCC command for compilation. The MATLAB Compiler's dependency analysis phase will automatically include dependent MATLAB files in the application (with notable exceptions being function calls that appear as part of strings).
Also, the other easy way of compiling an application is using DEPLOYTOOL, which opens a deployment tool window and this is a Graphical User Interface for creating applications for deployment.

More Answers (0)


Find more on C Shared Library Integration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by