This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

How Requirements Information Is Included in Generated Code

After you simulate your model and verify its performance against the requirements, you can generate code from the model for an embedded real-time application. The Embedded Coder® software generates code for Embedded Real-Time (ERT) targets.

If the model has any links to requirements, the Embedded Coder software inserts information about the requirements links into the code comments.

For example, if a block has a requirement link, the software generates code for that block. In the code comments for that block, the software inserts:

  • Requirement description

  • Hyperlink to the requirements document that contains the linked requirement associated with that block


    • You must have a license for Embedded Coder to generate code for an embedded real-time application.

    • If you use an external .req file to store your requirement links, to avoid stale comments in generated code, before code generation, you must save any change in your requirement links. For information on how to save, see Save Requirements Links in External Storage.

Comments for the generated code include requirements descriptions and hyperlinks to the requirements documents in the following locations.

Model Object with RequirementLocation of Code Comments with Requirements Links


In the main header file, <model>.h

Nonvirtual subsystem

At the call site for the subsystem

Virtual subsystem

At the call site of the closest nonvirtual parent subsystem. If a virtual subsystem does not have a nonvirtual parent, requirement descriptions appear in the main header file for the model, <model>.h.

Nonsubsystem block

In the generated code for the block

MATLAB® code line in MATLAB Function block

In the generated code for the MATLAB code line(s)

Was this topic helpful?