필터 지우기
필터 지우기

>40 seconds waiting for Undefined function or variable error 2017b

조회 수: 15 (최근 30일)
Adam Danz
Adam Danz 2017년 10월 30일
댓글: Borja Prieto 2022년 5월 18일
I'm using matlab 2017b on a windows 7 64 bit machine and when I accidentally reference a variable or function that doesn't exist, Matlab consumes a significant amount of time in 'busy' mode before throwing the error: 'Undefined function or variable'. I've paused the execution a few times to see where the bottleneck is and it has always opened the findUnlicensedFunctions() function. To cause this error, I type in any nonsense command such as "ttt" in the command window where ttt does not refer to any function or variable. Using tic/toc just before and after the call to ttt resulted in 43 seconds waiting for the error. Is anyone else experiencing this or might it be specific to my environment? I upgraded last week from 2016a and did not have this problem before.
  댓글 수: 3
Adam Danz
Adam Danz 2018년 8월 29일
Update: I received an email from the tech team claiming to have solved this problem in the new release which I suppose is 2018b (which hasn't been released yet).
Adam Danz
Adam Danz 2019년 4월 12일
Unforunately this is still a very frustrating problem (r2019a).
If you're connected to a wireless network and you call a function or a variable that contains a typo and therefore no longer corresponds to an existing function or variable, the delay for the error message to appear is up to a minute sometimes - just waiting for Matlab in the 'busy' state. Ctrl+c does not stop this process. Pausing it does not speed it up but eventually terminates in findUnlicensedFunctions().

댓글을 달려면 로그인하십시오.

채택된 답변

Adam Danz
Adam Danz 2018년 4월 22일
편집: Adam Danz 2019년 8월 25일
Apparently when a variable or function is called but not available, matlab searches network locations on the matlab path and if those connections are no longer accessible, this delay occurs. To confirm that this is what's causing the unbearably long deley, I turned off/on my internet connection(s) and the problem vanished when there wasn't a connection but immediately returned when there was a connection. The link below contains suggestions on how to troubleshoot this issue but doesn't fix it for good.
[UPDATE]
After dealing with the same problem off and on for years, I wrote a function that fixes it. The function below creates a GUI that lists all network drives that appear in your Matlab 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 was immediate for me and I no longer had 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.
  댓글 수: 1
Borja Prieto
Borja Prieto 2022년 5월 18일
Hi there,
I am a PC, R2020a user, and your function/GUI worked like a charm for me!
Thanks a million!

댓글을 달려면 로그인하십시오.

추가 답변 (6개)

Jakub Krizan
Jakub Krizan 2018년 4월 3일
I have never experienced this issue in Matlab 2017b, but it started to happen since I have upgraded to Matlab 2018a. The behavior is the same as Adam Danz describes. I am using Windows 10 64bit (build 1709)
  댓글 수: 1
Adam Danz
Adam Danz 2018년 4월 13일
I've also upgraded to 2018a and am disappointed that this is still an issue. Often times the delay is unbearable. (Windows 7, 64bit)

댓글을 달려면 로그인하십시오.


Mary Abbott
Mary Abbott 2017년 11월 2일
Thank you for reporting this. We have been able to reproduce this on our end, and I have forwarded the details to our development team so that they can investigate it further.

Jose
Jose 2018년 9월 9일
편집: Jose 2018년 9월 9일
Hello I am getting the same problem and I am getting crazy. In my case are not 40 seconds. Sometimes it takes 10 minutes. And turnning off the net connections dont solve anything. It happens anyway. I am desperate

Jose
Jose 2018년 9월 27일
편집: Jose 2018년 9월 27일
Today I installed the 2018b version and the problem is still there. So, I installed it, I ran it and I typed in the command line a variable that I didn t declare before, >> r and enter and it took 1 minute almost 2 to answer: Undefined function or variable 'r'.
Someone in Matlab is taking actions? I am really fed up of it.
ElCapitan OS
  댓글 수: 2
William Babbitt
William Babbitt 2019년 1월 13일
편집: William Babbitt 2019년 1월 13일
I am also experiencing this problem - Long (~ 1 minute) wait for error of undefinted variables/funtions. This started after I installed 2018b. It also may be related to running a script from our server (though the server is not in my path anymore). The problem goes away if I disconnect from the internet, but that is not a practical solution.
EDITED COMMENT
It was not my path, but my history. Running these commands solved it:
s = settings;
s.matlab.desktop.currentfolder.History.PersonalValue = {''}
Zachary Eilon
Zachary Eilon 2019년 8월 28일
This solution did not fix it for me - I think the history is saved somewhere else, so as soon as one navigates to a new directory, it repopulates even having cleared it with the above code. However, selecting "Clear History" under the "Current Folder" tab of the MATLAB preferences did the trick for permanently clearing the history.

댓글을 달려면 로그인하십시오.


Jose
Jose 2018년 10월 15일
In my case is solved. I was using external hard drives (usb connected). It turns out that by accident the power supply was off and I noticed that I was not having latencies anymore. I connected them and the latencies were there again. I am happy because I am not dealing with that delays anymore but in the other hand I can not use my hard drives during my working day with Matlab which is not nice.

Ryan Santos
Ryan Santos 2019년 8월 30일
Hey all,
First off, sorry for the problems everyone has been facing with the error recovery system. We added the feature in 2017b where upon encountering an unknown function or identifier, MATLAB will search through a users "current working directory" history and make suggestions based on that. Unfortunately what could sometimes happen is that some items in that history could no longer be accessable, causing the delay you're seeing here.
The workaround, as you already know, is to remove those problematic directories from your history. Though we understand that it is still frustrating and not always realistic since some directories could become innaccessable as your working and still cause an initial delay. We've been seeing more and more of this feedback from customers, so we are going to take some steps to try to alleviate this problem in a future release. We're working on it!
Thanks,
Ryan Santos

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by