Cannot CD to (name is nonexistent or not a directory)
Show older comments
I am getting this error at cd(folder).
thisFile = mfilename('C:\Users\user\Documents\mu\see');
[folder,name] = fileparts(thisFile);
cd(folder)
addpath('\do');
Accepted Answer
More Answers (1)
Image Analyst
on 14 Feb 2016
1 vote
That folder does not exist. Just because you typed it in does not mean it will exist. Call the mkdir() function to create it, but chances are you should not be using cd anyway, but creating full filenames with the fullfile() function instead. See the FAQ: http://matlab.wikia.com/wiki/FAQ#Where_did_my_file_go.3F_The_risks_of_using_the_cd_function.
Categories
Find more on File Operations 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!