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

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?

 Respuesta aceptada

Marc Jakobi
Marc Jakobi el 27 de Feb. de 2015
Editada: Marc Jakobi el 27 de Feb. de 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.

Más respuestas (0)

Categorías

Más información sobre Install Products en Centro de ayuda y File Exchange.

Preguntada:

el 27 de Feb. de 2015

Editada:

el 27 de Feb. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by