필터 지우기
필터 지우기

how to get folder name

조회 수: 2 (최근 30일)
Elysi Cochin
Elysi Cochin 2013년 10월 26일
답변: Walter Roberson 2013년 10월 26일
i have 4 folders named
1 - airplane
2 - baseball
3 - beach
4 - forest
now on calculation if i get value 2, i want to access all images in folder "2 - baseball"
i'm not getting the access correct... please do correct it for me...
BaseFileName = sprintf('%d*\\image_44', i);
FullFileName = fullfile('Training Dataset', BaseFileName);
imageFile = imread(FullFileName);
the error i get is
??? Error using ==> dicomread>newDicomread at 175
File "Training Dataset\6*\image_44" not found.
how to read that folder name.... please do reply.....

채택된 답변

Walter Roberson
Walter Roberson 2013년 10월 26일
folders = { '1 - airplane'
'2 - baseball'
'3 - beach'
'4 - forest' }
FullFileName = fullfile('Training Dataset', folders{i}, 'image_44.jpg');
See also

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by