Error in the total number of file count

3 Ansichten (letzte 30 Tage)
Nuno
Nuno am 28 Mai 2015
Beantwortet: Nuno am 28 Mai 2015
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

Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 28 Mai 2015
Bearbeitet: Sean de Wolski am 28 Mai 2015
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

Weitere Antworten (1)

Nuno
Nuno am 28 Mai 2015
It's ok now :)
Thanks

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by