MATLAB: Does a Scope block connected to a constant signal show only a single point instead of a constant line

simulink

Why does a Scope block connected to a constant signal show only a single point instead of a constant line?
It looks like the following:

Best Answer

In the simple case where a constant block is directly connected to a Scope block of "inherited" sample time, the Scope block inherits the inf sample time. This means that the scope block only executes once at the very start of simulation. See here for more details about inf sample time (also known as "Constant" sample time) -- https://www.mathworks.com/help/simulink/ug/types-of-sample-time.html#brrdmmw-10. If you change the sample time of the scope or connect a second signal that is not sampled at inf, it’ll behave as expected.
Now it looks like the following:
Other distinctions to make:
1. The Simulation Data Inspector doesn’t have a block-sorted execution order (i.e. to inherit sample times) so will show a continuous line if the above signal is logged.
2. The DSP time scope is "port-based" (as opposed to "block-based" so its behavior is unique when it comes to inheriting sample times and you will see what appears to be a continuous line if used in the above scenario (which is in fact sampled at the default discrete rate since this scope is optimized for discrete time processing).