How to save the data when we are using dir('*.hdf')
Show older comments
I have opened all files using MOD= dir('*.hdf'); but cannot able to use this to open these files or to extract some values form these files. Here is my script
MOD= dir('*.hdf');
for i=1:365
Name=MOD(i).name
if i ==1
AE(i)=hdfread(Name,'/mod08/Data Fields/Angstrom_Exponent_Land_Mean', 'Index', {[1 1],[1 1],[180 360]});
AOD(i)=hdfread(Name, '/mod08/Data Fields/Optical_Depth_Land_And_Ocean_Mean', 'Index', {[1 1],[1 1],[180 360]});
else
AE(:,:,i)=hdfread(Name, '/mod08/Data Fields/Angstrom_Exponent_Land_Mean', 'Index', {[1 1],[1 1],[180 360]});
AOD(:,:,i)=hdfread(Name, '/mod08/Data Fields/Optical_Depth_Land_And_Ocean_Mean', 'Index', {[1 1],[1 1],[180 360]});
end
end
When I run this program, there is an error showing, Subscripted assignment dimension mismatch.
Error in test2 (line )
AE(i)=hdfread(MOD(i).name
,'/mod08/Data
Fields/Angstrom_Exponent_Land_Mean',
'Index', {[1 1],[1 1],[180 360]});
Accepted Answer
More Answers (0)
Categories
Find more on Timetables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!