MATLAB: Question to mkdir and addpath

path

Hi
As I understand, the following code:
mkdir('c:/matlab/myfiles')
addpath('c:/matlab/myfiles')
First creates the folders in question, and in the second line makes it possible to call functions and the like from this folder (and all their subfolders and hence this is why it says the folders are added to the "top" of the search file?)
Unfortunately, I get the following warning (my script is called "test"):
Warning: Name is nonexistent or not a directory: c
> In path at 110
In addpath at 87
In test at 4
Warning: Name is nonexistent or not a directory: /matlab/myfiles
> In path at 110
In addpath at 87
In test at 4
What is that supposed to mean?

Best Answer

Try this
addpath(genpath('c:/matlab/myfiles'));
I do it all the time and it works great.