


clc;
clear;
files = 'Z:\Data2000-2001\';
lhs = ls([files,'*.hdf']);
m=size(lhs); % m is the number of files in every folders which is 25
for i=1:m(1,1) % or i=1:24
    aaa{i,1} = hdfinfo(lhs(i,:),'HDF'); % i is the variable which stands for the all days in every 8days
end


% 'MOD_Grid_500m_Surface_Reflectance' for whole day of data 2000-2001

clear;
clc;
lsh=ls('*.hdf');
m=size(lsh);
name{1,1}='sur_refl_b01'; 
name{1,2}='sur_refl_b02';
for i=1:m(1,1)     % m goes from 1 to m(1,1) which is 24 in this case. i = number of files. in order to increase the spead of runnig we can say i=1:3 or each number as we want
    aaa = hdfinfo(lsh(i,:),'EOS');
    name_1=(aaa.Grid.Name);   % name_1 : 'MOD_Grid_500m_Surface_Reflectance'
    for h=1:2    % h goes from 1 to 2 and counts for Surface Reflectance 1 & 2
    varname{i,h} = hdfread(lsh(i,:),name_1,'Fields',name{1,h}); 
    data{i,h} = double(varname{i,h});
   % figure('Color','white')
% load varname I do not need to load them because I have them in my work space
 figure % in order to have my data back to back i brought them here
axesm sinusoid
surfm(lat,long,data{i,h})% instead of i, and h we have to put # like:data{1,1}, data{1,2}, data{2,1}, data{2,2}. we have to change these number until we reacch to data_{24,1}, data_{24,2}

clear aaa
    end
end