How to count files with specific name?

26 次查看(过去 30 天)
Great friends, I need help. I made a .mat file strut format that lists all my HDF files. These files are a set of data per year. I want to count how many files have to each year. How to make? For example: file = dir ('AIRS *'); length (file ('AIRS.2003 *)) length (file ('AIRS.2004 *)) length (file ('AIRS.2005 *))
Thanks for your help.

采纳的回答

Walter Roberson
Walter Roberson 2016-3-31
file = dir ('AIRS *');
filenames = {file.name};
num2004 = sum( ~cellfun(@isempty, strfind(filenames, '2004')) )

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by