
Why does a Scope block connected to a constant signal show only a single point instead of a constant line?
    21 views (last 30 days)
  
       Show older comments
    
    MathWorks Support Team
    
 on 22 Apr 2020
  
    
    
    
    
    Edited: MathWorks Support Team
    
 on 3 Sep 2024
            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:

Accepted Answer
  MathWorks Support Team
    
 on 3 Sep 2024
        
      Edited: MathWorks Support Team
    
 on 3 Sep 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).
0 Comments
More Answers (0)
See Also
Categories
				Find more on Event Functions in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!