Why does a Scope block connected to a constant signal show only a single point instead of a constant line?

21 visualizaciones (últimos 30 días)
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:

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 3 de Sept. de 2024
Editada: MathWorks Support Team el 3 de Sept. de 2024
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).

Más respuestas (0)

Categorías

Más información sobre Event Functions en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by