Matlab ignoring pathdef updates

조회 수: 7 (최근 30일)
CM
CM 2021년 4월 28일
답변: CM 2021년 5월 4일
I have a bug that has happened twice now. It has a number of apparently unrelated symptoms that all start happening at the same time. I am running 2020a on windows with a machine licence, with signal processing and data acquisition toolbox. The symptoms are:
The data acquisition toolbox disappears. I reinstalled it last week when this bug happened and it was working fine up until today.
I get this warning on startup: Warning: Name is nonexistent or not a directory: C:\Users\user.name\AppData\Local\Temp\Editor_vxdxq
Changes to pathdef get ignored. I have confirmed via [which pathdef -all] that I only have one version, in the default location. I have confirmed that it gets updated when I set the path. But somehow matlab ends up with a different path, even if I reboot the PC.
It only happens when one user is signed in to windows. When I sign in with my account it does not happen (so far...).
I'll try reinstalling the toolbox for now, but this will cause me problems if it happens again at a bad time, so I need it fixed.
  댓글 수: 1
CM
CM 2021년 4월 28일
Update: the symptoms are slightly different this time. Everything works fine under my login, but not the other login. Last time the symptoms were present regardless of who was logged in to windows. I have tried reinstalling the data acquision toolbox but that did not fix it.

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

채택된 답변

CM
CM 2021년 5월 4일
Tech support were no help. But they have started spamming me again.
I think I have fixed the problem. Matlab somehow remembers old values for userpath, even if you clear it or reinstall matlab. If there is a copy of pathdef in there, it will use that pathdef rather than the default one. Not sure how, but this prevents the search path from updating. Maybe it loads from the old userpath but saves to the default location. This in turn can uninstall toolboxes.
The fix is to delete pathdef from the old userpath.
There is no way of seeing where the old userpath is. You have to guess. Maybe do a windows search.

추가 답변 (1개)

Steven Lord
Steven Lord 2021년 4월 28일
You wrote "The data acquisition toolbox disappears." Does that mean that calling functions in that toolbox don't work or does it mean when you navigate to the toolbox directory under matlabroot using Windows File Explorer that there is no subdirectory for that toolbox?
If the latter that's obviously not expected behavior. Was there a particular function or series of functions that the user who experienced this behavior ran between the last time they knew Data Acquisition Toolbox was available and the first time it was missing? I'm trying to eliminate the possibility someone accidentally or maliciously added code to those functions to delete the Data Acquisition Toolbox directory.
Since "It only happens when one user is signed in to windows. When I sign in with my account it does not happen (so far...)." have you confirmed that the user doesn't have a pathdef.m of their own (independent of the one included in MATLAB) in the directory in which they (or their desktop shortcut) starts MATLAB? You indicated that you only see one pathdef.m but that doesn't preclude the other user from having a different pathdef.m.
If none of these expose the cause of this behavior, you should contact Technical Support and work with them to diagnose this problem. They should be able to work with you with a shorter feedback cycle than Answers posts (including no delay if you call them up.)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by