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

5 vues (au cours des 30 derniers jours)
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.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 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', ...
...
'fileN.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:
web([docroot,'/techdoc/matlab_prog/ch_com25.html'])
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.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Compiler dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by