To my understanding, your scope display is automatically disappearing.
You can refer to Troubleshoot Delayed or Missing Scope Output MathWorks documentation page to find more on troubleshooting steps for missing scope output.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!