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
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 个)

类别

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