"Warning: Name is nonexistent or not a directory:" when not connected to network drive

2 views (last 30 days)
Hi.
I have a set of folders in my Matlab path that are on a network drive. I do not want to sync the drive to my PC, because it would use up too much space. In order to connect to the network drive, I have to manually open it in Windows when I am connected to the network it is in, and use a VPN connection to open it when I am in a different network.
Every time I start up Matlab and I am not connected to the drive, I get a warning message (see title) for every folder on the drive, which is a little annoying.
Is there a way to disable the warning message for the folders on the drive?

Accepted Answer

Marc Jakobi
Marc Jakobi on 27 Feb 2015
Edited: Marc Jakobi on 27 Feb 2015
Okay, nevermind, I found a solution.
1. Give yourself editing rights to the file matlabrc.m 2. Between the lines 32 and 33 that contain the following code:
if exist('pathdef','file') && ...
~exist('RESTOREDEFAULTPATH_EXECUTED','var')
matlabpath(pathdef);
end
add the line
warning('off','MATLAB:dispatcher:pathWarning')
So it looks like this:
if exist('pathdef','file') && ...
~exist('RESTOREDEFAULTPATH_EXECUTED','var')
warning('off','MATLAB:dispatcher:pathWarning')
matlabpath(pathdef);
end
Not the cleanest solution, since it disables all warnings about missing paths, but sufficient for my problem, since I never really need the warning.

More Answers (0)

Categories

Find more on Search Path in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!