Double-clicking a Scope block for which the window is already open while the simulation is running causes the glitch for a discrete signal. The glitch appears due to a bug with the Scope block in Simulink 8.4 (R2014b) and Simulink 8.5 (R2015a).
There are two workarounds to address this issue:
1) You can switch to the new Time Scope introduced in Simulink 8.5 (R2015a) by clicking the "Try Time Scope" toolbar button on the Scope window.
2) In Simulink 8.4 (R2014b), you can check the "Limit data points to last" option and set the value to a sufficiently large number. You can also do this on the command line using the following commands:
>> limit = 200000;
>> set_param(gcb,'LimitDataPoints','on');
>> set_param(gcb,'MaxDataPoints',limit);
Best Answer