External Code Import - MATLAB & Simulink (original) (raw)

Main Content

Choose and apply options for importing external MATLAB®, C, or C++ code

The code generator includes a variety of approaches for integrating legacy or custom code with generated code. Legacy code is existing handwritten code or code for environments that you integrate with code that the code generator produces. Custom code is legacy code or other user-specified lines of code that you include in the code generator build process. Collectively, legacy and custom code are called external code.

You integrate external code by importing existing external code into code produced by the code generator. You can import code by calling an external function by using C Function blocks, C Caller blocks, or S-functions. To place external code at specific locations in generated code, you can include Custom Code blocks in a model or use model configuration parameters in theCustom pane. When you import external code, the resulting generated code interfaces with generated scheduling code.

For guidance on choosing an approach based on your application requirements, see Choose an External Code Integration Workflow.

Blocks

Topics

Workflow Overview

Import External Code Into Generated Code