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]}); endend
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]});
Best Answer