Guy on Simulink

Simulink & Model-Based Design

Legends for Simulink Scopes 11

Posted by Guy Rouleau,

Today my colleague Roshin Kadanna Pally is back to talk about additions he made to the Simulink Scope in R2012a.

Legends for Simulink Scopes

When opening the Scope parameters dialog in R2012a, you will notice a new option:

Simulink Scope parameters

When simulating the model, the legend will appear and you will be able to choose its position:

Setting the position of the Scope legend

The selected position will be saved with model.

The information displayed in the legend can come from multiple sources in the model:

  • Signal name
  • Block name if signal is not named
  • Name of elements for composite signals
  • Port number if source block has multiple ports
  • Signal index for vectors

I tried to illustrate all those in the following example:

Scope Naming Convention

Now it's your turn

Are you happy the legends are now available in the Simulink Scope? Leave a comment here.

11 CommentsOldest to Newest

Eike Petersen replied on : 1 of 11

Kind of happy, yes. However I think, this feature should have been included at the same moment scopes have been – for what is a graph without a legend good for? In the beginning I really couldn’t believe there was no possibility to display one.

Anyway, fine to finally have this. :)

Eike Petersen replied on : 2 of 11

By the way, why do I have to rerun the simulation in order to display a legend although the data is already present? I think that is kind of counter-intuitive…

Kind regards,


Roshin Kadanna Pally replied on : 3 of 11

This is a performance optimization. Signal names used in legend strings are determined only if legends are enabled before starting the simulation. They are also not saved for later use.

cyprien replied on : 4 of 11

Dear Sir
I need H,inf matlab code and comments included,applied on non linearity system for both siso and MiMo.

you can send to me a typical non linearity transfer function.

use saturation or and quantizer to include non linearity.

thank you

Eike Petersen replied on : 5 of 11

@Roshin: I expected the reason to be something like that, but I still think that changing that behavior should at least be considered in favor of usability.

In the mean time I have come across another situation where the scope legend naming does not work as I expected it to:

I have a setup containing 4 named signals connected to a mux block. The output of this mux block is connected to a gain block which is in turn connected to the scope.
The scope does not recognize any names of my signals. Once I remove the gain block, all names are displayed properly. It seems that the gain block prevents signal names from being propagated.

Is there any way to have the 4 signals’ names still be properly displayed in the scope in spite of the gain block?

Kind regards,


Roshin Kadanna Pally replied on : 6 of 11

In future, this behavior will be user-friendly.

Currently, there isn’t any easy way to display the signal names of the four signals on the mux in the presence of a gain block. They will show up as Gain:1, Gain:2, etc. If you name the output line of the Gain block to xyz, the names will appear as xyz:1, xyz:2, etc. This is a known limitation and we will consider improving it.


Robert Garnett replied on : 7 of 11

Legend good, but please, please put integrated dual cursors with delta t and delta y on the scopes and provide access to the graphics tools of normal figures.

In the process industry where we have long time runs with lots of data these are really needed.

Ray replied on : 8 of 11

HOW do you get the legend text to be the signal name or other options? The output of my integrator is a temperature. I have the scope block labeled temperature, i have the integrator output labled temperature, heck I’ve labeled everything I could find as “temperature” and the darn legend still says “integrator”. This SHOULD be very simple and obvious -what am I missing? Student version 2012a

Guy Rouleau replied on : 9 of 11

@Ray: I am not sure what is happening. Typically, when the signal is named, the Scope will use that first. If the signal is not named, then it will use the block name.

If you cannot figure it out, I recommend contacting technical support.

Engin Tujumet replied on : 10 of 11


I was wondering whether there is a way to programatically (i.e. via code) modify the location of the Scope legends.

maybe something like this?

simscope(‘Legend’, ‘Location’, ‘NorthEast’, scopeHandle)

Ali Osman replied on : 11 of 11

Thank you for this good sharing.

I’m preparing a homework. Help please.

Matlab Help / SimPowerSystem I / FACTS Model / UPFC has the circuit model.
How can I draw the results of this circuit on Matlab GUI?

simplot? simscope? get_param / set_param? :(

Add A Comment

Your email address will not be published. Required fields are marked *


Preview: hide