Paths and File Infrastructure Setup
Compile Path Search Order
MATLAB® Coder™ resolves MATLAB functions by searching first on the code generation path and then on the MATLAB path. The code generation path contains the current folder and the code generation libraries. By default, unless MATLAB Coder determines that a function should be extrinsic or you explicitly declare the function to be extrinsic, MATLAB Coder tries to compile and generate code for functions it finds on the path. MATLAB Coder does not compile extrinsic functions, but rather dispatches them to MATLAB for execution. See Resolution of Function Calls for Code Generation.
Specify Folders to Search for Custom Code
If you want to integrate custom code — such as source, header, and library files — with the generated code, you can specify additional folder to search. The following table describes how to specify these search paths. The path should not contain:
Spaces (Spaces can lead to code generation failures in certain operating system configurations)
Tabs
\
,$
,#
,*
,?
Non-7-bit ASCII characters, such as Japanese characters
To specify additional folders | Do this |
---|---|
Using the MATLAB Coder app |
|
At the command line | Use the codegen function
-I option. |
Naming Conventions
MATLAB Coder enforces naming conventions for MATLAB functions and generated files.
Conventions for Naming Generated Files
The following table describes how MATLAB Coder names generated files. MATLAB Coder follows MATLAB conventions by providing platform-specific extensions for MEX files. See MEX Platform Compatibility.
Platform | MEX File Extension | MATLAB Coder Extension for Static Library | MATLAB Coder Extension for Shared Library | MATLAB Coder Executable Extension |
---|---|---|---|---|
Windows® (64-bit) | .mexw64 | .lib | .dll
Also, generates an import library with a .lib extension that is required for linking
against the .dll . | .exe |
Linux® (64-bit) | .mexa64 | .a | .so | None |
macOS with Apple silicon (64-bit) | .mexmaca64 | .a | .dylib | None |
macOS with Intel® (64-bit) | .mexmaci64 | .a | .dylib | None |