Plotting suddenly not coming up

54 visualizaciones (últimos 30 días)
June Yang
June Yang el 12 de Jul. de 2017
Respondida: Patrick el 1 de Nov. de 2022
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?

Respuestas (2)

James Tursa
James Tursa el 12 de Jul. de 2017
Editada: James Tursa el 12 de Jul. de 2017
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.

Patrick
Patrick el 1 de Nov. de 2022
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!

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by