Filter löschen
Filter löschen

Error using cd Cannot CD to /Users/man​anmehta/Do​cuments/MA​TLAB/datas​et/1 (Name is nonexistent or not a directory). Error in load_database (line 12) cd(strcat(​'/Users/ma​nanmehta/D​ocuments/M​ATLAB/data​set/',num2​str(i)));

2 Ansichten (letzte 30 Tage)
function out=load_database()
% We load the database the first time we run the program.
persistent loaded;
persistent w;
status=mkdir('/Users/mananmehta/Documents/MATLAB/dataset/stereo-pairs/cones');
disp(status);
if(isempty(loaded))
v=zeros(10304,400);
for i=1:40
cd(strcat('/Users/mananmehta/Documents/MATLAB/dataset/',num2str(i)));
for j=1:10
a=imread(strcat(num2str(j),'.png'));
v(:,(i-1)*10+j)=reshape(a,size(a,1)*size(a,2),1);
end
cd ..
end
w=uint8(v); % Convert to unsigned 8 bit numbers to save memory.
end
loaded=1; % Set 'loaded' to aviod loading the database again.
out=w;

Antworten (1)

Jason Ross
Jason Ross am 22 Mär. 2013
You are making a directory '/Users/mananmehta/Documents/MATLAB/dataset/stereo-pairs/cones' but then changing directory to '/Users/mananmehta/Documents/MATLAB/dataset/'.
Should you be changing directory to '/Users/mananmehta/Documents/MATLAB/dataset/stereo-pairs/cones'
If this is the case, I'd suggest putting the directory name in a variable and then using the variable in both places to avoid this kind of error.

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by