Limiting the number of Matlab figure windows
Show older comments
There probably isn't a solution to this (other than to stop messing things up), but I figured it's worth an ask. Often while debugging my code, I'll insert various figure/plot commands to see what is going on with the data and make sure I'm getting the right answer. Ideally, once I think I've got things working, I'll comment all of these out or delete them, but sometimes I'll miss a few with frustrating results. In older versions of Matlab, it would crash after say 20 figures. But now (with 2019a) it seems perfectly happy to freeze all processes on my computer while it dutifully attempts to plot 600+ figures. Is there some internal limit on figure windows that can be set to curb this behavior?
Accepted Answer
More Answers (2)
Andreas Bernatzky
on 18 Dec 2019
Edited: Andreas Bernatzky
on 18 Dec 2019
0 votes
You should consider debugging without plotting and use breakpoints instead.
I do not know the maximum limit of possible plots because that depends on the data you plot (arraySize for example). But in theory I think the limitiation of possible plots is the (dynamic) memory your computer has left for usage. And freezing your computer is exactly what happens if your computer uses all of its memory...
Sandy Throckmorton
on 18 Dec 2019
0 votes
1 Comment
Bootstrap2110
on 15 May 2023
I agree with you. I have the same issue. When code is big with lots of scripts calling each other internally its easy to miss disabling a few plots. I also wish there was a way to set the max numer of plots after which matlab can just ignore plotting.
Categories
Find more on Whos 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!