Error in the total number of file count

Hello everyone!
I need to make the dicom file count in a directory and i try the following code:
dirname = uigetdir([]);
d = dir([dirname, '\*.dcm']);
but always gives me the error
" Index exceeds matrix dimensions."
Anyone know how i can fix it?
Thanks

 채택된 답변

Sean de Wolski
Sean de Wolski 2015년 5월 28일
편집: Sean de Wolski 2015년 5월 28일

0 개 추천

which dir
which uigetdir
You might have shadowed "dir" or "uigetdir". Clear/rename that variable/function and try again.
If this isn't it then you've likely shadowed a common function which uigetdir/dir is using. Run the following to set the state to stop on errors. Repeat what you're doing and it will stop and you can see what variable/function is causing the error and where.
dbstop if error

추가 답변 (1개)

Nuno
Nuno 2015년 5월 28일

0 개 추천

It's ok now :)
Thanks

카테고리

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

태그

질문:

2015년 5월 28일

답변:

2015년 5월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by