Don't know why this isn't working anymore. Very simple. I have a script with a folder in the same path. The folder contains a series of m files for the script to work.
Originally I simply would use
addpath('.../utilities/);
when the script was first run. but recently I started receiving this error
Warning: Name is nonexistent or not a directory: ...\utilities
In path (line 109)
In addpath (line 88)
In Myrunningcode (line 101)
and I don't know why.
I fixed the problem by running the following code
p = mfilename('fullpath');
[filepath,~,~] = fileparts(p);
addpath([filepath,'/utilities/']);
At least I would like to know why this error occurred.
Here is my directory setup. I use windows 10 and matlab 2016a.

fullfileinstead of manually concatenating with (OS dependent) file separators. If your error is a direct copy of the actual error, it would appear you've used a backslash where your example cites a forward slash, this inconsistency is a red flag. The issue is likely that your current directory (pwd) is not the same as the file location (perhaps it was when your code worked) - the relative directory isn't relative to the current script, it's relative topwd, hence why themfilenameworkaround fixes your issue.addpathevery time I run the script.addpath('.../utilities/);you will get a warning using...\utilities, as it knows you mean that. Using/will make the code OS-independent.