Skip to content
MathWorks - Mobile View
  • Sign In to Your MathWorks AccountSign In to Your MathWorks Account
  • Access your MathWorks Account
    • My Account
    • My Community Profile
    • Link License
    • Sign Out
  • Products
  • Solutions
  • Academia
  • Support
  • Community
  • Events
  • Get MATLAB
MathWorks
  • Products
  • Solutions
  • Academia
  • Support
  • Community
  • Events
  • Get MATLAB
  • Sign In to Your MathWorks AccountSign In to Your MathWorks Account
  • Access your MathWorks Account
    • My Account
    • My Community Profile
    • Link License
    • Sign Out

Videos and Webinars

  • MathWorks
  • Videos
  • Videos Home
  • Search
  • Videos Home
  • Search
  • Contact sales
  • Trial software
15:57 Video length is 15:57.
  • Description
  • Related Resources

Basics of Code Generation

From the series: Improving Your Racecar Development

Spend more time on algorithm development and less time manually producing code. With the click of a button, you can bring algorithms to C/C++ code and hardware with code generation. Christoph Hahn and Application Engineer Andreas Uschold, both of MathWorks, walk through the basics of code generation and the tools available to simplify and speed up the process.

Code generation tools are a great alternative to manual coding, which is time consuming and error prone. There is a benefit to having the entire process in one tool chain where, for example, an electrical Formula Student team developing vehicle dynamics controllers, such as torque vectoring, can bring it to its CPU as quickly as possible.

Andreas depicts a typical industry workflow for code generation using the Design V, which is a design workflow used by many automotive companies. Looking at this in Simulink®, the example shown is a typical, closed-loop control system with a controller and a piece of hardware you want to control. To generate code out of the system, you simply press a button in MATLAB® and Simulink and get C/C++ code. The generated code complies with the ANSI ISO C standard and is as readable as good manual generated C code.

Having the code does not mean it is running on the hardware so Andreas then gives an overview of hardware support packages and their benefits. Hardware support packages are available for different hardware platforms and enable you to embed and deploy your code.

Ultimately, Model-Based Design helps detect bugs early and speeds up the development process. This is a great overview of code generation and we will go into the individual steps in more detail in future episodes.

Below are links to software and hardware products and services mentioned in the episode:

  • Simulink Real-Time™
  • Speedgoat hardware and services for rapid control prototyping
  • Hardware support packages

Two episodes of the MATLAB and Simulink student lounge are closely connected to that topic. In the first video processor-in-the-loop (PIL) testing is explained more in detail and in the second video a top of the world electric Formula Student team explains their approach to code generation and testing.

Related Products

  • Simulink

Learn More

Watch related videos for students
Contact the MathWorks student competition team

Bridging Wireless Communications Design and Testing with MATLAB

Read white paper
Related Information
Watch related videos for students

Feedback

Featured Product

Simulink

  • Request Trial
  • Get Pricing

Up Next:

Learn a variety of modeling methods to fit your racecar needs. We’ll demonstrate five modeling approaches and share tips on how to choose the right model. Also, find all models used in the episode on the MATLAB Central FileExchange.
29:49
Modeling Physical Components, Part 2: Data-Driven Concepts
View full series (29 Videos)

Related Videos:

16:12
Accelerating Optimization, Test, and Code Generation with...
33:43
Instrumentation and Microcontrollers Using Automatic Code...
26:03
Automatic Code Generation of AUTOSAR Software Components...
11:13
Run a Simulink Model on Zynq: Code Generation and...
5:58
Connecting Systems and the HDL World: Rapid RTL Generation

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

  • Switzerland (English)
  • Switzerland (Deutsch)
  • Switzerland (Français)
  • 中国 (简体中文)
  • 中国 (English)

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • Contact sales
  • Trial software

MathWorks

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Discover…

Explore Products

  • MATLAB
  • Simulink
  • Student Software
  • Hardware Support
  • File Exchange

Try or Buy

  • Downloads
  • Trial Software
  • Contact Sales
  • Pricing and Licensing
  • How to Buy

Learn to Use

  • Documentation
  • Tutorials
  • Examples
  • Videos and Webinars
  • Training

Get Support

  • Installation Help
  • MATLAB Answers
  • Consulting
  • License Center
  • Contact Support

About MathWorks

  • Careers
  • Newsroom
  • Social Mission
  • Customer Stories
  • About MathWorks
  • Select a Web Site United States
  • Trust Center
  • Trademarks
  • Privacy Policy
  • Preventing Piracy
  • Application Status

© 1994-2022 The MathWorks, Inc.

  • Facebook
  • Twitter
  • Instagram
  • YouTube
  • LinkedIn
  • RSS

Join the conversation