MATLAB and Simulink for Embedded Systems

Design, code, and verify embedded systems

With the push of a button, you can use MATLAB® and Simulink® to generate code and run it on hardware. However, coding is just one task – learn how you can use MATLAB and Simulink to design, code, and verify your next embedded system from prototyping to production. You can: 

  • Partition and schedule algorithms for single- and multi-core devices.
  • Make cost vs. performance tradeoffs using single-precision and fixed-point design tools.
  • Generate C, C++, CUDA, HDL, and Structured Text for MCUs, DSPs, GPUs, FPGAs, and PLCs.
  • Prototype on popular hardware including ARM, Intel, NVIDIA, NXP, STMicroelectronics, TI, and Xilinx using MATLAB add-ons.
  • Comply with standards such as AUTOSAR, ISO 26262, DO-178, CERT C, and MISRA C.

Experience the Joy of MATLAB to C

Explore the following code to see how easy it is to prepare, test, and generate C from MATLAB:

The simple MATLAB function below multiplies two inputs:

function c = myMult(a, b)

% Multiply two inputs
c = a * b; 

Given scalar inputs, MATLAB Coder generates the following C code:

#include "myMult.h"

double myMult(double a, double b)
     return a * b;

The same piece of MATLAB code, when given two matrix inputs, generates three nested for-loops in C:

void myMult(const double a[12], const double b[20], double c[15])
  int i0;
  int i1;
  int i2;
  for (i0 = 0; i0 < 3; i0++) {
    for (i1 = 0; i1 < 5; i1++) {
      c[i0 + 3 * i1] = 0.0;
      for (i2 = 0; i2 < 4; i2++) {
        c[i0 + 3 * i1] += a[i0 + 3 * i2] * b[i2 + (i1 << 2)];

Read the Full Article "Experience the Joy of MATLAB to C"

In this article, you'll learn tips and best practices for generating C code. You'll see industry examples of successful applications of generated code by companies such as Delphi, Baker Hughes, iSonea, and dorsaVi.

Download the Code Generation Examples

Follow along with the article by downloading the code examples. You'll get both the files along with workflow instructions.

Try the example now

Generate Production Code from Simulink

Download an interactive tutorial that guides you through the implementation of a high-level PID throttle controller to a production executable with an accompanying test harness and code metrics report. Topics include data specification, legacy code integration, and build processes.

Go from basic tasks to more advanced maneuvers by walking through interactive examples and tutorials.

Request a Trial

Contact us for a custom evaluation.