Why do I get an "undefined function" error and loss of command functionality when I start MATLAB?
조회 수: 1 (최근 30일)
이전 댓글 표시
I receive the following error when starting MATLAB:
??? Undefined function or variable 'usejava'.
Error in ==> /matlab/toolbox/local/matlabrc.m
On line 24 ==> if usejava('Desktop')
After that, when I try to use any MATLAB commands, I receive further errors.
채택된 답변
MathWorks Support Team
2012년 2월 14일
This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
This issue is due to a corrupt pathdef.m file, which contains a list of the directories in the MATLAB search path.
To resolve this issue, see the following:
If you are using MATLAB 7.0 (R14), type the following commands:
restoredefaultpath ; matlabrc
If this command resolves the issue, type the following command to save the current path for all future sessions of MATLAB:
savepath
If you are using versions of MATLAB prior to MATLAB 7.0 (R14), follow the appropriate instructions below:
For Windows Installations
Start MATLAB, and enter the following commands:
matlabpath(char(com.mathworks.jmi.MatlabPath.getDefaultPath))
path2rc(fullfile(matlabroot,'toolbox','local','pathdef.m'))
This will regenerate your pathdef.m file.
If you still have problems, send a copy of your pathdef.m file from $MATLAB/toolbox/local/ to support@mathworks.com and mention Solution 1-1AVEG in the subject field.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!