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

18 views (last 30 days)
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

Categories

Find more on File Name Construction in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!