Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

code generation: difference between grt and ert model

Asked by Carlos

Carlos (view profile)

on 10 Nov 2011

Hi all, I'm generating a target for embedded hardware. And I need the most efficient code and take up little memory.

  • What is the difference between a model generated with grt.tlc or ert.tlc?
  • In order to generate embedded code is enough to put these two lines in my entry tlc?

%assign CodeFormat = "Embedded-C"

rtwgensettings.DerivedFrom = 'ert.tlc';

Thank you,



Carlos (view profile)


No products are associated with this question.

1 Answer

Answer by Titus Edelhofer

Titus Edelhofer (view profile)

on 10 Nov 2011
Accepted answer


for the first question: grt uses a larger memory model and is a target for generic use (as the name says) mostly on the host PC. ert (embedded real-time target) is using a smaller memory model, and optimizes better for speed and memory. To generate code using ert you might just choose the ert.tlc on the Simulink Parameters page.


1 Comment

Kaustubha Govind

Kaustubha Govind (view profile)

on 10 Nov 2011

To add to Titus' answer, there is some more information about how ert.tlc (Embedded Coder) extends the capabilities of grt.tlc (Simulink Coder):

Also, if you are writing your own custom target (or entry TLC as you called it), yes, I believe what you described is the right way to do it. In fact, the description in the documentation for custom target development does use ert.tlc:

Titus Edelhofer

Titus Edelhofer (view profile)

Contact us