External Code Integration for Code Generation

You can integrate external code with MATLAB® code intended for code generation. The external code can be external libraries, object files, or C/C++ source code.

The basic workflow is:

  1. Create the external code.

  2. Call the external code from MATLAB code.

  3. Specify the external file locations.

  4. Generate code from the MATLAB code.

Call the external code and specify the file locations in one of the following ways:

  • Use coder.ExternalDependency to encapsulate the interface to the external code. The updateBuildInfo method specifies file locations and other build information. Write methods that define the programming interface to the external functions. In your MATLAB code, use these methods to call the external functions.

  • Use coder.ceval to call external functions from your MATLAB code. When you generate code, define the locations of external files.

  • Use coder.ceval to call external functions from your MATLAB code. Use coder.updateBuildInfo to specify external file locations and update build information.

See Also

| |

More About

Was this topic helpful?