MATLAB 2018a stalls on undefined variables
Afficher commentaires plus anciens
MATLAB was running fine, but today it keeps hanging. I can replicate this error very reliably and I've been able to determine that the problem is caused by a undefined variable. Essentially, every time that MATLAB encounters an undefined variable (whether in function, script, or command line), it hangs at "Busy" instead of quickly producing the typical error, "Undefined function or variable."
A previous post on this issue is found here: https://www.mathworks.com/matlabcentral/answers/395876-undefined-function-error-is-very-slow-to-occur#answer_315892. But in my case, MATLAB hangs regardless of whether I use a local directory or my wifi is turned off or on. So it doesn't seem to be related to a network issue.
Version information:
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.4.0.813654 (R2018a)
MATLAB License Number: ••••••
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 15063)
Java Version: Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
Additional information:
I restarted MATLAB several times, with the same symptom each time. The problem is not encountered when using MATLAB 2017a on the same computer.
4 commentaires
Rik
le 31 Juil 2018
To ask the obvious question for completion's sake: a restart of your OS didn't improve the situation?
Yeah, I griped about this too nearly a year ago and Matlab staff claimed to have forwarded this issue along to their development team after they replicated the problem. Three releases later and it's still a problem. Actually, it's an enormous problem. The delays are often unbearable and when troubleshooting code, the 'undefined variable' error is common.
Douglas Cook
le 31 Juil 2018
Adam Danz
le 31 Juil 2018
It could be due to your computer resetting the network connections as suggested here . In my case, I access a remove "z-drive" at work and when I take my laptop home an no longer have access to the z-drive, I get this problem. When I restart matlab it typically goes away. Also, when I turn off my wifi it typically goes away, too.
Réponses (2)
Jose
le 27 Sep 2018
0 votes
I do have the same problem. Adam system is not working for me. I am a Mac user. I lose a lot of time every day just with that. So sad...
1 commentaire
Adam Danz
le 22 Août 2019
It somestimes doesn't work for me either. It's not so much of a solution as it is a bandaid that needs repeatedly addressed. I think this is one of Matlab's biggest issues and the problem has existed for years.
Zachary Eilon
le 22 Août 2019
0 votes
I am also having this issue, having just updated to 2019a. It is very frustrating. Happens whenever I cd to a new directory in my external server. This "feature" of searching back through the history is absurd if it has this consequence.
5 commentaires
Adam Danz
le 24 Août 2019
@Zachary Eilon, after dealing with the same problem off and on for years, today I wrote a function that fixes it. When you run the function without any inputs, a GUI will appear that will list any drives that appear in history. You can select any (or all) of the drives that you no longer have access to and it will remove those from your history. The effect is immediate and you no longer have to deal with the wait time. Other options in the GUI allow you to restore the history from a backup if needed. It's a pretty simple.
If you're interested (and if you're a PC user) please give it a shot and let me know if it works for you, too.
Zachary Eilon
le 28 Août 2019
Thanks - Mac user here, so did not end up trying this. I reached out to MATLAB and in the meantime managed to solve it crudely by pushing "Clear History" in the "Current Folder" tab of the MATLAB preferences. Weirdly, this resolved the problem even once I re-added the same network directories to my history (by visiting them) and then navigating elsewhere.
Adam Danz
le 28 Août 2019
I believe that "clear history" button does the same thing as the GUI.
Bruno Luong
le 28 Août 2019
Can someone shed a light on the link between search path and user history?
Adam Danz
le 28 Août 2019
It's not 100% clear to me either partially becaues it's not documented well (or at all?).
The search path has clear descriptions in the documentation as well as the command history. In addition to that, there's the Current Folder history which lists your history of cd(). Apparently starting around r2017b (?) when there is an undefined variable or function matlab searches through the current folder history. When there are paths to networks that no longer exist, it takes a very long time for matlab to throw the undefined var/func error (sometimes up to a minute just because there was a typo). I'd be happy for anyone to add more detail to that.
Catégories
En savoir plus sur Performance and Memory dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!