How to get the file names that start with the same letter in the folder?

3 views (last 30 days)
PENGYUAN TAN
PENGYUAN TAN on 17 Sep 2021
Commented: PENGYUAN TAN on 18 Sep 2021
How to get the file names that start with the same letter in the folder?

Accepted Answer

KSSV
KSSV on 17 Sep 2021
Edited: KSSV on 17 Sep 2021
f = dir('T*.bin') ;
N = length(f) ;
for i = 1:N
f(i).name
end

More Answers (2)

Matt J
Matt J on 17 Sep 2021
Edited: Matt J on 17 Sep 2021
For example,
s=dir('T*_imag.bin');
fileNames={s([s.isdir]==0).name}

Chunru
Chunru on 17 Sep 2021
fn = dir('T*.*') % you can use 'T*.T', 'T15*.bin', etc

Tags

Community Treasure Hunt

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

Start Hunting!