Use the coder.ExternalDependency
class to encapsulate
the interface between external code and MATLAB® code intended
for code generation. With the encapsulation, you can separate the
details of the interface from your MATLAB code. The methods of coder.ExternalDependency
:
specify the location of external files
update build information
define the programming interface for external functions
In your MATLAB code, you can call the external code without providing build information.
The workflow is:
Write a class definition file for a class that derives
from coder.ExternalDependency
.
Store the class definition file in a folder on the MATLAB path.
In your MATLAB code, use a method of the class to call an external function.
Generate code from your MATLAB code.