function [ DataCor,N0,Nf,Delta] = correcao_brancos( imput )
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
data_nef = imput;
N0 = sum(isnan(imput));
    %21/08/2018
    
    data_nef(data_nef(:,1)<datenum(2018,8,21,17,00,00)) = NaN;
    data_nef(data_nef(:,1)>=datenum(2018,8,21,18,41,00) &...
            data_nef(:,1)<=datenum(2018,8,21,19,02,00),2:size(data_nef,2))=NaN;
    for i = 18:3:24
        data_nef(data_nef(:,1)>=datenum(2018,8,21,i,12,00) &...
            data_nef(:,1)<=datenum(2018,8,21,i,33,00),2:size(data_nef,2))=NaN; %Y MO DAY H MI S
    end
    %22/08/2018
    data_nef(data_nef(:,1)>=datenum(2018,8,22,03,15,00) &...
            data_nef(:,1)<=datenum(2018,8,22,03,35,00),2:size(data_nef,2))=NaN;
        data_nef(data_nef(:,1)>=datenum(2018,8,22,06,15,00) &...
            data_nef(:,1)<=datenum(2018,8,22,06,35,00),2:size(data_nef,2))=NaN;
        data_nef(data_nef(:,1)>=datenum(2018,8,22,09,15,00) &...
            data_nef(:,1)<=datenum(2018,8,22,09,35,00),2:size(data_nef,2))=NaN;
     for i = 12:3:21
         data_nef(data_nef(:,1)>=datenum(2018,8,22,i,04,00) &...
             data_nef(:,1)<=datenum(2018,8,22,i,44,00),2:size(data_nef,2))=NaN;
     end
    data_nef(data_nef(:,1)>=datenum(2018,8,22,16,21,00) &...
            data_nef(:,1)<=datenum(2018,8,22,16,26,00),2:size(data_nef,2))=NaN;
    %23/08/2018
    data_nef(data_nef(:,1)>=datenum(2018,8,23,00,09,00) &...
            data_nef(:,1)<=datenum(2018,8,23,00,41,00),2:size(data_nef,2))=NaN;
    for i = 3:3:12
        data_nef(data_nef(:,1)>=datenum(2018,8,23,i,09,00) &...
            data_nef(:,1)<=datenum(2018,8,23,i,41,00),2:size(data_nef,2))=NaN;
    end
    for i = 14:3:23
        data_nef(data_nef(:,1)>=datenum(2018,8,23,i,50,00) &...
            data_nef(:,1)<=datenum(2018,8,23,i+1,44,00),2:size(data_nef,2))=NaN;
    end
    %24/08/2018
    for i = 3:3:12
        data_nef(data_nef(:,1)>=datenum(2018,8,24,i,02,00) &...
            data_nef(:,1)<=datenum(2018,8,24,i,25,00),2:size(data_nef,2))=NaN;
    end  
    for i = 14:3:20
        data_nef(data_nef(:,1)>=datenum(2018,8,24,i,43,00) &...
            data_nef(:,1)<=datenum(2018,8,24,i+1,28,00),2:size(data_nef,2))=NaN;
    end 
     data_nef(data_nef(:,1)>=datenum(2018,8,24,21,39,00) &...
            data_nef(:,1)<=datenum(2018,8,24,22,24,00),2:size(data_nef,2))=NaN;
    %25/08/2018
    data_nef(data_nef(:,1)>=datenum(2018,8,25,00,50,00) &...
            data_nef(:,1)<=datenum(2018,8,25,01,15,00),2:size(data_nef,2))=NaN;
    data_nef(data_nef(:,1)>=datenum(2018,8,25,19,49,00) &...
            data_nef(:,1)<=datenum(2018,8,25,20,11,00),2:size(data_nef,2))=NaN;
    data_nef(data_nef(:,1)>=datenum(2018,8,25,22,49,00) &...
            data_nef(:,1)<=datenum(2018,8,25,23,08,00),2:size(data_nef,2))=NaN;
    for i = 3:3:18
        data_nef(data_nef(:,1)>=datenum(2018,8,25,i,50,00) &...
            data_nef(:,1)<=datenum(2018,8,25,i+1,15,00),2:size(data_nef,2))=NaN;
    end
    %26/08/2018
    data_nef(data_nef(:,1)>=datenum(2018,8,26,01,48,00) &...
            data_nef(:,1)<=datenum(2018,8,26,02,06,00),2:size(data_nef,2))=NaN;
    data_nef(data_nef(:,1)>=datenum(2018,8,26,02,32,00) &...
            data_nef(:,1)<=datenum(2018,8,26,02,56,00),2:size(data_nef,2))=NaN;   
    for i = 5:3:23
        data_nef(data_nef(:,1)>=datenum(2018,8,26,i,35,00) &...
            data_nef(:,1)<=datenum(2018,8,26,i,57,00),2:size(data_nef,2))=NaN;
    end   
    %27/08/2018 
    for i = 2:3:23
            data_nef(data_nef(:,1)>=datenum(2018,8,27,i,35,00) &...
            data_nef(:,1)<=datenum(2018,8,27,i,57,00),2:size(data_nef,2))=NaN;
    end   
    data_nef(data_nef(:,1)>=datenum(2018,8,27,18,39,00) &...
            data_nef(:,1)<=datenum(2018,8,27,18,52,00),2:size(data_nef,2))=NaN;
    data_nef(data_nef(:,1)>=datenum(2018,8,27,23,05,00) &...
            data_nef(:,1)<=datenum(2018,8,27,23,57,00),2:size(data_nef,2))=NaN;
    %28/08/2018 
    for i = 1:3:24
            data_nef(data_nef(:,1)>=datenum(2018,8,28,i,50,00) &...
            data_nef(:,1)<=datenum(2018,8,28,i+1,35,00),2:size(data_nef,2))=NaN;
    end 
    data_nef(data_nef(:,1)>=datenum(2018,8,28,22,35,00) &...
            data_nef(:,1)<=datenum(2018,8,28,23,05,00),2:size(data_nef,2))=NaN;
        
    %29/08/2018 
    for i = 1:3:24
            data_nef(data_nef(:,1)>=datenum(2018,8,29,i,35,00) &...
            data_nef(:,1)<=datenum(2018,8,29,i+1,18,00),2:size(data_nef,2))=NaN;
    end 
    %30/08/2018 
    for i = 1:3:24
            data_nef(data_nef(:,1)>=datenum(2018,8,30,i,15,00) &...
            data_nef(:,1)<=datenum(2018,8,30,i+1,02,00),2:size(data_nef,2))=NaN;
    end 
    %31/08/2018 
    for i = 1:3:24
            data_nef(data_nef(:,1)>=datenum(2018,8,31,i,30,00) &...
            data_nef(:,1)<=datenum(2018,8,31,i,57,00),2:size(data_nef,2))=NaN;
    end 
    data_nef(data_nef(:,1)>=datenum(2018,8,31,0,15,00) &...
            data_nef(:,1)<=datenum(2018,8,31,0,50,00),2:size(data_nef,2))=NaN;
        
    %01/09/2018
    for i = 2:3:23
        data_nef(data_nef(:,1)>=datenum(2018,9,1,i,26,05) &...
            data_nef(:,1)<=datenum(2018,9,1,i,54,07),2:size(data_nef,2))=NaN;
    end
    data_nef(data_nef(:,1)>=datenum(2018,9,1,1,26,05) &...
            data_nef(:,1)<=datenum(2018,9,1,1,54,07),2:size(data_nef,2))=NaN;
    %02/09/2018
    for i = 1:3:23
        data_nef(data_nef(:,1)>=datenum(2018,9,2,i-1,30,05) &...
            data_nef(:,1)<=datenum(2018,9,2,i,03,07),2:size(data_nef,2))=NaN;
    end
    %03/09/2018
    for i = 12:3:23
        data_nef(data_nef(:,1)>=datenum(2018,9,3,i,10,05) &...
            data_nef(:,1)<=datenum(2018,9,3,i,41,07),2:size(data_nef,2))=NaN;
    end
    data_nef(data_nef(:,1)>=datenum(2018,9,3,23,53,00) &...
            data_nef(:,1)<=datenum(2018,9,4,00,30,00),2:size(data_nef,2))=NaN;
    %04/09/2018
    for i = 3:3:23
        data_nef(data_nef(:,1)>=datenum(2018,9,4,i,00,00) &...
            data_nef(:,1)<=datenum(2018,9,4,i,30,00),2:size(data_nef,2))=NaN;
    end
    %05/09/2018
    data_nef(data_nef(:,1)>=datenum(2018,9,5,00,04,00) &...
            data_nef(:,1)<=datenum(2018,9,5,00,40,00),2:size(data_nef,2))=NaN;
    for i = 1:3:23
            data_nef(data_nef(:,1)>=datenum(2018,9,5,i,00,00) &...
            data_nef(:,1)<=datenum(2018,9,5,i,36,00),2:size(data_nef,2))=NaN;
    end        
    %06/09/2018
    for i = 1:3:23
            data_nef(data_nef(:,1)>=datenum(2018,9,6,i,13,00) &...
            data_nef(:,1)<=datenum(2018,9,6,i,51,00),2:size(data_nef,2))=NaN;
    end  
    %07/09/2018
    for i = 1:3:22
            data_nef(data_nef(:,1)>=datenum(2018,9,7,i,50,00) &...
            data_nef(:,1)<=datenum(2018,9,7,i+1,13,00),2:size(data_nef,2))=NaN;
    end 
    %08/09/2018
    data_nef(data_nef(:,1)>=datenum(2018,9,8,01,41,00) &...
            data_nef(:,1)<=datenum(2018,9,8,02,50,00),2:size(data_nef,2))=NaN;
     for i = 5:3:23
            data_nef(data_nef(:,1)>=datenum(2018,9,8,i,21,00) &...
            data_nef(:,1)<=datenum(2018,9,8,i,52,00),2:size(data_nef,2))=NaN;
     end 
    %09/09/2018
    for i = 1:3:22
            data_nef(data_nef(:,1)>=datenum(2018,9,9,i,22,00) &...
            data_nef(:,1)<=datenum(2018,9,9,i,58,00),2:size(data_nef,2))=NaN;
    end 
    %10/09/2018
    for i = 1:3:22
            data_nef(data_nef(:,1)>=datenum(2018,9,10,i-1,14,00) &...
            data_nef(:,1)<=datenum(2018,9,10,i-1,43,00),2:size(data_nef,2))=NaN;
    end 
    %11/09/2018
    for i = 3:3:22
            data_nef(data_nef(:,1)>=datenum(2018,9,11,i,45,00) &...
            data_nef(:,1)<=datenum(2018,9,11,i+1,10,00),2:size(data_nef,2))=NaN;
    end      
    data_nef(data_nef(:,1)>=datenum(2018,9,11,00,15,00) &...
            data_nef(:,1)<=datenum(2018,9,11,01,13,00),2:size(data_nef,2))=NaN; 
    data_nef(data_nef(:,1)>=datenum(2018,9,11,19,43,00) &...
            data_nef(:,1)<=datenum(2018,9,11,20,43,00),2:size(data_nef,2))=NaN;      
    %16/09/2018
    for i = 1:3:22
            data_nef(data_nef(:,1)>=datenum(2018,9,16,i,10,00) &...
            data_nef(:,1)<=datenum(2018,9,16,i,46,00),2:size(data_nef,2))=NaN;
    end  
    %17/09/2018
    for i = 1:3:22
            data_nef(data_nef(:,1)>=datenum(2018,9,17,i,25,00) &...
            data_nef(:,1)<=datenum(2018,9,17,i,50,00),2:size(data_nef,2))=NaN;
    end
    %18/09/2018
    for i = 2:3:20
            data_nef(data_nef(:,1)>=datenum(2018,9,18,i,32,00) &...
            data_nef(:,1)<=datenum(2018,9,18,i,59,00),2:size(data_nef,2))=NaN;
    end 
    %19/09/2018
    for i = 2:3:22
            data_nef(data_nef(:,1)>=datenum(2018,9,19,i,32,00) &...
            data_nef(:,1)<=datenum(2018,9,19,i+1,02,00),2:size(data_nef,2))=NaN;
    end 
    %20/09/2018
    for i = 1:3:20
            data_nef(data_nef(:,1)>=datenum(2018,9,20,i-1,48,00) &...
            data_nef(:,1)<=datenum(2018,9,20,i,13,00),2:size(data_nef,2))=NaN;
    end  
    %21/09/2018
    for i = 1:3:23
            data_nef(data_nef(:,1)>=datenum(2018,9,21,i-1,30,00) &...
            data_nef(:,1)<=datenum(2018,9,21,i-1,57,00),2:size(data_nef,2))=NaN;
    end 
    %22/09/2018
    for i = 1:3:23
            data_nef(data_nef(:,1)>=datenum(2018,9,22,i-1,30,00) &...
            data_nef(:,1)<=datenum(2018,9,22,i,03,00),2:size(data_nef,2))=NaN;
    end 
    %23/09/2018
    for i = 1:3:23
            data_nef(data_nef(:,1)>=datenum(2018,9,23,i-1,40,00) &...
            data_nef(:,1)<=datenum(2018,9,23,i,13,00),2:size(data_nef,2))=NaN;
    end 
    %24/09/2018
    data_nef(data_nef(:,1)>=datenum(2018,9,24,00,15,00) &...
            data_nef(:,1)<=datenum(2018,9,24,00,56,00),2:size(data_nef,2))=NaN;
    for i = 3:3:23
            data_nef(data_nef(:,1)>=datenum(2018,9,24,i,34,00) &...
            data_nef(:,1)<=datenum(2018,9,24,i+1,03,00),2:size(data_nef,2))=NaN;
    end 
    %25/09/2018
    data_nef(data_nef(:,1)>=datenum(2018,9,25,00,38,00) &...
            data_nef(:,1)<=datenum(2018,9,25,00,58,00),2:size(data_nef,2))=NaN;
    for i = 3:3:22
            data_nef(data_nef(:,1)>=datenum(2018,9,25,i,34,00) &...
            data_nef(:,1)<=datenum(2018,9,25,i+1,03,00),2:size(data_nef,2))=NaN;
    end 
    data_nef(data_nef(:,1)>=datenum(2018,9,25,19,05,00) &...
            data_nef(:,1)<=datenum(2018,9,25,19,13,00),2:size(data_nef,2))=NaN;        
    %26/09/2018   
    data_nef(data_nef(:,1)>=datenum(2018,9,26,20,24,00) &...
            data_nef(:,1)<=datenum(2018,9,26,20,52,51),2:size(data_nef,2))=NaN;   
    %28/09/2018   
    data_nef(data_nef(:,1)>=datenum(2018,9,28,20,28,00) &...
            data_nef(:,1)<=datenum(2018,9,28,20,47,51),2:size(data_nef,2))=NaN;
    %29/09/2018   
    data_nef(data_nef(:,1)>=datenum(2018,9,29,00,10,00) &...
            data_nef(:,1)<=datenum(2018,9,29,00,33,54),2:size(data_nef,2))=NaN; 
    %01/10/2018   
    data_nef(data_nef(:,1)>=datenum(2018,10,01,00,26,00) &...
            data_nef(:,1)<=datenum(2018,10,01,00,28,00),2:size(data_nef,2))=NaN;
    %02/10/2018   
    data_nef(data_nef(:,1)>=datenum(2018,10,02,00,02,00) &...
            data_nef(:,1)<=datenum(2018,10,02,00,22,00),2:size(data_nef,2))=NaN;    
    %02/10/2018   
    data_nef(data_nef(:,1)>=datenum(2018,10,3,00,16,00) &...
            data_nef(:,1)<=datenum(2018,10,3,00,34,00),2:size(data_nef,2))=NaN;   
    %04/10/2018   
    data_nef(data_nef(:,1)>=datenum(2018,10,4,00,04,00) &...
            data_nef(:,1)<=datenum(2018,10,4,00,25,00),2:size(data_nef,2))=NaN; 
    %05/10/2018   
    data_nef(data_nef(:,1)>=datenum(2018,10,5,00,00,00) &...
            data_nef(:,1)<=datenum(2018,10,5,00,25,00),2:size(data_nef,2))=NaN;       
     %06/10/2018   
    data_nef(data_nef(:,1)>=datenum(2018,10,6,00,00,00) &...
            data_nef(:,1)<=datenum(2018,10,6,00,25,00),2:size(data_nef,2))=NaN;  
    data_nef(data_nef(:,1)>=datenum(2018,10,6,3,12,00) &...
            data_nef(:,1)<=datenum(2018,10,6,3,39,00),2:size(data_nef,2))=NaN; 
    %07/10/2018   
    data_nef(data_nef(:,1)>=datenum(2018,10,7,00,00,00) &...
            data_nef(:,1)<=datenum(2018,10,7,00,26,00),2:size(data_nef,2))=NaN; 
    %11/10/2018   
    data_nef(data_nef(:,1)>=datenum(2018,10,11,23,23,00) &...
            data_nef(:,1)<=datenum(2018,10,11,23,28,00),2:size(data_nef,2))=NaN;     
    data_nef(data_nef(:,1)>=datenum(2018,10,11,23,47,00) &...
            data_nef(:,1)<=datenum(2018,10,12,00,10,00),2:size(data_nef,2))=NaN; 
    %11/10/2018      
    data_nef(data_nef(:,1)>=datenum(2018,10,15,23,02,00) &...
            data_nef(:,1)<=datenum(2018,10,15,23,21,00),2:size(data_nef,2))=NaN; 
    %17/10/2018      
    data_nef(data_nef(:,1)>=datenum(2018,10,17,00,07,00) &...
            data_nef(:,1)<=datenum(2018,10,17,00,27,00),2:size(data_nef,2))=NaN; 
    %18/10/2018      
    data_nef(data_nef(:,1)>=datenum(2018,10,18,23,52,00) &...
            data_nef(:,1)<=datenum(2018,10,19,00,16,00),2:size(data_nef,2))=NaN; 
    %21/10/2018      
    data_nef(data_nef(:,1)>=datenum(2018,10,21,15,30,00) &...
            data_nef(:,1)<=datenum(2018,10,21,15,39,00),2:size(data_nef,2))=NaN;  
    %22/10/2018      
    data_nef(data_nef(:,1)>=datenum(2018,10,22,17,47,00) &...
            data_nef(:,1)<=datenum(2018,10,22,18,02,00),2:size(data_nef,2))=NaN;
    %05/11/2018      
    data_nef(data_nef(:,1)>=datenum(2018,11,05,18,50,00) &...
            data_nef(:,1)<=datenum(2018,11,05,22,00,00),2:size(data_nef,2))=NaN;    
Nf = sum(isnan(data_nef));  
Delta = N0 - Nf;
DataCor = data_nef;
end

