Plotting suddenly not coming up
조회 수: 34 (최근 30일)
이전 댓글 표시
Hi Everyone,
So sometimes Matlab will stop popping out figures even when I'm running the exact code that used to make beautiful plots a moment ago. It happens a lot to me and my solution has always just been to restart Matlab, in which then the code will work normally. I always assumed that it is probably because I messed up something or created some object while I was messing with other editors in the workspace, but does any one know why exactly? Also, how do you fix this problem other than just restarting the workspace?
댓글 수: 0
답변 (2개)
James Tursa
2017년 7월 12일
편집: James Tursa
2017년 7월 12일
This is just a guess, but perhaps you are running a script which populates the current workspace with variables, and those variables are interfering with a "clean" re-running of the script. E.g., maybe you inadvertently created a variable named "plot" in your script, and that is interfering with calling the actual plot function when you re-run the script. Things like this can cause the same code to behave differently because the code inadvertently uses some of those pre-existing variables. You could scrub your code to look for stuff like this, or maybe convert your code into a function to force it to start with a clean workspace every time it runs.
To get a more detailed response to your question you would have to post your code for us to look at.
댓글 수: 0
Patrick
2022년 11월 1일
I had the same issue. I went through my live script and simply broke it into more sections so that no section was exceptionally long. It works now. Note that I did restart MatLab a couple time during the troubleshooting too but what made the difference in the end was creating more section breaks.
Good luck!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!