How do I read all of the hdf files in a directory sequentially while performing calculations on each one?

3 views (last 30 days)
I want to read an hdf file, e.x.:
data=hdfread('abc000', 'stuff')
Then I want to do some analysis on the file, output the result to a new variable ('output000'), and then move on to the next file, 'abc005', then onto 'abc010', 'abc015', etc. each with a corresponding output variable.
What is the best way to approach this? Is there a way to read the next file in a directory each time a loop (for loop?) executes, and have the output variable also increment in number? Or do I need to just read the entire directory of hdf files first and then do the analysis all at once? (although I still don't really know how to automate that process)

Answers (1)

dpb
dpb on 28 Feb 2014

Community Treasure Hunt

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

Start Hunting!