ouss ben (view profile)

Asked by ouss ben

ouss ben (view profile)

on 1 Feb 2012
Latest activity Commented on by Anurag Khergade

Anurag Khergade (view profile)

on 15 Feb 2018
Accepted Answer by Gareth

Gareth (view profile)

I get this message everytime i open matlab
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

Gareth (view profile)

on 16 Feb 2012

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.

Sam2012

Sam2012 (view profile)

on 7 Jul 2012
thanx that worked perfectly for me .. although cant figure waht the problem actually was
Jason Atwood

Jason Atwood (view profile)

on 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 (view profile)

on 11 Nov 2017
Worked like a charm :) Thanks

Jason Ross (view profile)

Answer by Jason Ross

Jason Ross (view profile)

on 2 Feb 2012

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)

ouss ben

ouss ben (view profile)

on 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 (view profile)

on 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.

Sanjay Manohar (view profile)

Answer by Sanjay Manohar

Sanjay Manohar (view profile)

on 3 Mar 2017

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.