title: Read and process multiple .TIFF files using MATLAB
body: <p>I have problem on read and process multiple tiff file using MATLAB since I am beginner in MATLAM software. I have 300 of tiff images with same dimension. I want to loop the process, however, I cannot get it. Until now, I only change the file-name every time to read and process. I still don't get where should start. Can anyone help me. Here I attach my coding. </p>
  
  <pre><code>filename=('brd06330_s0239.tif');
  fileinfo=imfinfo(filename);
  Nfiles=numel(fileinfo); 
  Cloud=cell(Nfiles,1); 
  
     for n=1:Nfiles
  
       A=imread(filename);
       [rimg cimg]=size(A);
  % Read by band (for this task only use band 1)    
        B1Channel = A(:, :, 1);
  
  
   %  A=imread(filename);
   % [rimg cimg]=size(A);
  
  %for channel 1
   W_countB1 = sum(sum(B1Channel == 0)) % W= water
   NW_countB1 = sum(sum(B1Channel &gt; 0)) % NW= non water (cloud and land)
  
  
     end
  
     %save in text format(excel)
     d=[W_countB1,NW_countB1]
     colname={W_countB1,NW_countB1}
     xlswrite('brd06330_s0239',d)
  </code></pre>