Generate C and C++ code automatically courtesy of MathWorks -

Generate C and C++ code automatically courtesy of MathWorks


MathWorks just unveiled three automatic source code-generation products designed to take days and even weeks off of engineering projects. MATLAB Coder, allowing design engineers to generate readable, portable C and C++ code automatically from their MATLAB algorithms. The new product eliminates the time-intensive translation of MATLAB algorithm code for prototyping, implementation and software integration. The result is having only one design in MATLAB, the ability to test more systematically, the elimination of additional design errors when translating, and the ease with which complex MATLAB algorithms are converted into C code for integration into final product.

 With the conversion process in place, productivity gains account for days to weeks of precious time

Features of MATLAB Coder include:

  • ANSI/ISO compliant C and C++ code generation
  • MEX function generation for fixed-point and floating-point math
  • Project management tool for specifying entry points, input data properties and other code-generation configuration options
  • Static or dynamic memory allocation for variable-size data
  • Code generation support for many functions and system objects
  • Support for common MATLAB features, including matrix operations, subscripting, program control statements, and structures

Simultaneously, MathWorks also announced Simulink Coder. Formerly Real-Time Workshop, Simulink Coder generates and executes C and C++ from both Simulink diagrams and Stateflow charts. The resulting source code can be used for real-time and non-real-time applications, including simulation acceleration, rapid prototyping and hardware-in-the-loop testing. It allows users to tune and monitor the generated code using Simulink or run and interact with the code outside MATLAB and Simulink.

Features of Simulink Coder include:

  • ANSI/ISO C and C++ code and executables for discrete, continuous, or hybrid Simulink and Stateflow models
  • Incremental code generation for large models
  • Integer, floating-point, and fixed-point data type support
  • Code Generation for single-rate, multirate and asynchronous models
  • Single-tasking, multitasking, and bare-board compatibility
  • External mode simulation for code tuning and monitoring.

Finally, the MathWorks Embedded Coder generation readable, compact and fast C and C++ code for use on embedded processors, on-target rapid prototyping boards, and microprocessor used in mass production. Embedded coder delivers additional MATLAB Coder and Simulink Coder configuration options and advanced optimizations for fine-grain control of generated code functions, files and data. The product features built-in support for ATOSAR and ASAP2 software standards as well as traceability reports, code interface documents, and automated software verification to support DO-178 IEC 61408 and ISO 26262 software development. MATLAB users in the embedded space can also take advantage of the productivity gains inherent in automatic code generation.

Embedded Coder features include:

  • Optimization and code configuration options that extend MATLAB Coder and Simulink Coder
  • Storage class, type, and alias definition us Simulink data dictionary capabilities
  • Processor-specific code optimization
  • Multirate, multitask, and multicore code execution with or without an RTOS
  • Code verification, including SIL and PIL testing, custom comments, and code reports with tracing of models to and from code and requirements
  • Integration of Texas Instruments’ Code Composer Studio, Analog Devices VisualDSP++, and other third-party embedded development environments

Targeting aerospace and defense, communications, electronics, and semiconductors, MATLAB Coder is available immediately. U.S. list prices start at $6,500. Simulink Coder applications include automotive, aerospace and defense, industrial automation and machinery, and communications, electronics and semiconductors. Currently available, U.S. list price starts at $3,250. Embedded Coder is also available, and lists in the U.S. at $5,500.

Additional information can be found at:

MATLAB Code Product Details and video:

Simulink Coder Product Details and video:

Embedded Coder Product Details:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.