I get this message everytime i open matlab
Warning: C:\Program Files\MATLAB\R2011b\toolbox\local\pathdef.m not found.
Toolbox Path Cache is not being used. Type 'help toolbox_path_cache' for more info
Undefined function or variable 'ispc'.
Warning: MATLAB did not appear to successfully set the search path. To recover for this session of MATLAB, type "restoredefaultpath;matlabrc". To find out how to avoid this warning the next time you start MATLAB, type "docsearch problem path" after recovering for this session.
Warning: Duplicate directory name: C:\Program Files\MATLAB\R2011b\toolbox\local.
Warning: Initializing Handle Graphics failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup,
which should be resolved as soon as possible. Error detected was:
MATLAB:undefinedVarOrClass
Undefined variable "graphics" or class "graphics.internal.initializeMATLABRoot".
Warning: Initializing Java preferences failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup,
which should be resolved as soon as possible. Error detected was:
MATLAB:UndefinedFunction
Undefined function 'usejava' for input arguments of type 'char'.
> In matlabrc at 113
Warning: Failed to add default profiler filters.
> In matlabrc at 161
How can i resolve this problem

 Akzeptierte Antwort

Gareth
Gareth am 16 Feb. 2012

11 Stimmen

I've just put a clean install of 2011b onto a newly rebuilt Win7 machine and had the same problem. The issue appears to be that the pathdef.m file is absent, rather than corrupt or mis-located.
Having performed the "restoredefaultpath;matlabrc" fix mentioned above I then navigated to the C:\Program Files\MATLAB\R2011b\toolbox\local folder and typed "savepath pathdef.m". The system now appears to be working normally.

10 Kommentare

Sam2012
Sam2012 am 7 Jul. 2012
thanx that worked perfectly for me .. although cant figure waht the problem actually was
Jason Atwood
Jason Atwood am 16 Sep. 2012
Bearbeitet: Jason Atwood am 16 Sep. 2012
Same problem here. Solution worked +1. I'll just add to those reading this, the "restoredefaultpath;matlabrc" command might take a minute; keep an eye on the busy/ready signal from MATLAB.
auir 57
auir 57 am 11 Nov. 2017
Worked like a charm :) Thanks
Muhannad Al-Qaisi
Muhannad Al-Qaisi am 23 Mär. 2020
back from 2020 , worked +2. <3
Yamane
Yamane am 25 Mär. 2020
this is an answer that help ! thanks
MB
MB am 11 Apr. 2020
Thanks !!! It actually worked :)
Andres Felipe Herrera Acero
Andres Felipe Herrera Acero am 16 Apr. 2020
Buen día, alguien me podria ayudar con este error. No se que es Mecanografiar el archivo. Si me pueden ayudar con el paso a paso gracias.
Hannes Qualo
Hannes Qualo am 22 Apr. 2020
Cheers! Worked for me.
Rafal
Rafal am 24 Okt. 2022
Solution still works(2020b), thanks!
breathi
breathi am 14 Apr. 2025
When working with multiple users on a device and/or users without admin rights, the solution is more likely related to restriced access rights to the pathdef.m. Using the method described here will likely fix it for your user, but destroy it for everyone else.
Check the other reply by Sanjay to see if it is an access right problem first (by trying to edit pathdef.m in an extrnal editor).

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (3)

Sanjay Manohar
Sanjay Manohar am 3 Mär. 2017

4 Stimmen

I found this was because of an user access control problem. The file MATLAB\toobox\local\pathdef.m was not accessible.
I had to go to "Program Files\MATLAB" in explorer, right click, properties, security, permissions, Add, Everyone, Allow full access.
This solved the problem.

3 Kommentare

Anurag Khergade
Anurag Khergade am 15 Feb. 2018
Thank you Sanjay
John Taco Lopez
John Taco Lopez am 5 Nov. 2020
it worked for me in 2017b, thanks
Serge
Serge am 30 Aug. 2023
The accepted answer did not work for me, but this answer did!
So this did NOT work:
1) >> restoredefaultpath;matlabrc
2) cd C:\Program Files\MATLAB\<version>\toolbox\local\
3) >> savepath pathdef.m (and said ok on the Admin prompt that came up and it did write a pathdef.m file)
I also tried to do the same when running MatLab as administrator, but with no luck.
But this did work:
1) Navigate to C:\Program Files\MATLAB\<version>\toolbox\local\pathdef.m
2) right click > properties > security > Edit > Add > Type "Everyone" > Ok > Select Everyone > tick "Full Controll" > Ok
(Note you may need to create the file first, if missing, using the first 3 step)

Melden Sie sich an, um zu kommentieren.

Jason Ross
Jason Ross am 2 Feb. 2012

0 Stimmen

Did you do what it tells you to do in the message?
"To recover for this session of MATLAB, type "restoredefaultpath;matlabrc". To find out how to avoid this warning the next time you start MATLAB, type "docsearch problem path" after recovering for this session."
You basically need to get the path into a decent shape (using restoredefaultpath) and then figure out how it got there and fix it (using the doc reference provided)

2 Kommentare

ouss ben
ouss ben am 6 Feb. 2012
Yes I did what's told to do in this message.
It repairs the problem temporarily, but once I start for a second time I have the same problem.
Can I create or download a pathdef.m file?
Image Analyst
Image Analyst am 6 Feb. 2012
Search all your m-files (I assume you know how to do that in a variety of ways) for "savepath" and see if it's there. Perhaps you're messing up the path and then saving some bad path.

Melden Sie sich an, um zu kommentieren.

GAB_image
GAB_image am 14 Jan. 2020
Bearbeitet: GAB_image am 14 Jan. 2020

0 Stimmen

Hello,
I'm using Mac Catalina OS for running Matlab 2019b and I'm getting the following error-warning message when initiating the session:
Warning: Initializing preferences failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup, which should
be resolved as soon as possible. Error detected was:
MATLAB:format:UnknownOption
Invalid format option sh.
> In matlabrc (line 52)
Screen Shot 2020-01-14 at 9.43.25.png
I have tryied "restoredefaultpath;matlabrc" but did not work ... and "savepath" as well but also did not work...
Matlab 2019b works and open session in the correct path folder but the warning - error does not disappear
How could I solve this problem ?
Thanks a lot

Kategorien

Tags

Gefragt:

am 1 Feb. 2012

Kommentiert:

am 14 Apr. 2025

Community Treasure Hunt

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

Start Hunting!

Translated by