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

4 vues (au cours des 30 derniers jours)
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?

Réponse acceptée

Marc Jakobi
Marc Jakobi le 27 Fév 2015
Modifié(e) : Marc Jakobi le 27 Fév 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.

Plus de réponses (0)

Catégories

En savoir plus sur Install Products dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by