how can i store file path in string?

like this
f=strcat('E:\OneDrive\matlab\FYP\MMU Iris Database\MMU Iris Database\',num2str(c1),num2str(c2),num2str(c3),'\1\*.bmp')
img=dir(f);
img is not reading path
thanks in advance

댓글 수: 3

Akira Agata
Akira Agata 2018년 1월 31일
What is the size of img after running your code? If .bmp files are stored in your directory, img will be N-by-1 struct array (N is a total number of .bmp files in your directory).
A nicer version of your code:
f = ['E:\OneDrive\matlab\FYP\MMU Iris Database\', ...
'MMU Iris Database\', sprintf('%d%d%d', c1, c2, c3), ...
'\1\*.bmp')
img = dir(f);
Now please explain, what "img is not reading path" means. What happens, if you run the code and what do you want instead?
Walter Roberson
Walter Roberson 2018년 1월 31일
I notice you are using OneDrive. Are you using Windows 10? Because OneDrive on Windows 10 has some glitch in interacting with MATLAB so that "on-demand" files are not available.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 File Operations에 대해 자세히 알아보기

질문:

2018년 1월 25일

댓글:

2018년 1월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by