Skip to Main Content Skip to Search
Product Documentation

Algorithm Development Workflows

You can use MathWorks code generation technology to generate standalone C or C++ source code for embedded systems:

The following figure shows the design and deployment environment options. Although not shown in the figure, other products that support code generation, such as Stateflow software, are available.

The following table summarizes how to generate C or C++ code for each of the approaches and identifies where you can find more information.

If you develop algorithms using... You generate code by...For more information, see...
Code generation from MATLAB

Using MATLAB Coder projects

Entering the function codegen in the MATLAB Command Window

Workflow Overview in the MATLAB Coder documentation.
Simulink and StateflowConfiguring and initiating code generation for your model or subsystem with the Simulink Configuration Parameters dialog.Simulink and Stateflow Model in the Simulink Coder documentation
Code generation from MATLAB and Simulink

Including MATLAB code in Simulink models or subsystems by using the MATLAB Function block.

To use this block, you can do one of the following:

  • Copy your code into the block.

  • Call your code from the block by referencing the files on the MATLAB path.

Code Generation from MATLAB documentation

MATLAB Function block in the Simulink documentation

To use MATLAB code and Simulink models for a Model-Based Design project:

Benefits of this approach include:

If you are familiar with C language constructs and want to learn about how to map commonly used C constructs to code generated from model design patterns that include Simulink blocks, Stateflow charts, and MATLAB functions, see Patterns for C Code in the Embedded Coder documentation.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS