I need to read data from all .h5 files that are stored in a folder

 Accepted Answer

hfiles = dir('*.h5') ;
N = length(hfiles) ;
% loop for each file
for i = 1:N
thisfile = hfiles(i).name ;
% read the file
end

4 Comments

Hello SIr,Thank you Sir , I have executed the code it is not showning any error but Iam unable to read the data stored in the .h5 files
My h5 files consist of huge data related to atmospheric parameters(Eg:3DSND_01MAY2018_0000_L2B_SA1.h5)
I would like to read all the data stored in different .h5 files that are stored in a folder using for loop
You need to initialize the array before loop.
hello sir ,could you explain the detailed code of how to intialize an array
Storing huge data might lead to memory full problem. Try to load one file and process it what you want and store the required output.
An array of size m*n can be intialized using:
A =zeros(m,n) ;

Sign in to comment.

More Answers (0)

Products

Asked:

on 16 Mar 2020

Commented:

on 27 Mar 2020

Community Treasure Hunt

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

Start Hunting!