The compiler uses a dependency analysis function to automatically determine what additional MATLAB® files are required for the application to compile and run. These files are automatically compiled into the generated binary. The compiler does not generate any wrapper code allowing direct access to the functions defined by the required files.
If you are using one of the compiler apps, the required files discovered by the dependency analysis function are listed in the Files required by your application to run field.
To add files:
Click the plus button in the field.
Select the desired file from the file explorer.
To remove files:
Select the desired file.
Press the Delete key.
Removing files from the list of required files may cause your application to not compile or to not run properly when deployed.
If you are using
mcc to compile your MATLAB code,
the compiler does not display a list of required files before running.
Instead, it compiles all of the required files that are discovered
by the dependency analysis function and adds them to the generated
You can add files to the list by passing one, or more,
-a arguments add
the specified files to the list of files to be added into the generated
binary. For example,
-a hello.m adds the file
the list of required files and
-a ./foo adds all
of the files in
foo, and its subfolders, to the
list of required files.