1 function s=hdf2struct(f)
2 % function s=hdf2struct(f)
3 % read HDF4 file into a structure
7 for k=1:length(i.Attributes)
8 field=strrep(i.Attributes(k).Name,' ','_');
9 s.attr.(field)=i.Attributes(k).Value;
13 field=strrep(name,' ','_');
15 s.data.(field)=hdfread(f,name);