function [sep1 sep2 sep3 sep4 sep5 sep6 sep7 sep8 sep9 sep10 sep11 sep12 sep13 sep14 sep15 sep16 sep17 sep18 sep19 sep20 sep21 sep22 sep23 sep00] = extracthours (M)

sep1 = [];
sep2 = [];
sep3 = [];
sep4 = [];
sep5 = [];
sep6 = [];
sep7 = [];
sep8 = [];
sep9 = [];
sep10 = [];
sep11 = [];
sep12 = [];
sep13 = [];
sep14 = [];
sep15 = [];
sep16 = [];
sep17 = [];
sep18 = [];
sep19 = [];
sep20 = [];
sep21 = [];
sep22 = [];
sep23 = [];
sep00 = [];

s = size (M);
n = s (1);

sepe =[NaN,NaN,NaN,NaN];

for i = 1 : n
    
    year = M (i,1);
    month = M (i,2);
    hour = M (i,4);
    
    var = M (i,5);
    
    if day == 1
                    
        sep1 = [sep1;year,month,day,var];
        
        
    end 
    
    a = isempty (sep1);
    
    if (a == 1)
        
        sep1 = [sep1;sepe];
        
    end 
    
    if day == 2 
        
        sep2 = [sep2;year,month,day,var];
        
    end 
    
    a = isempty (sep2);
    
    if (a == 1)
        
        sep2 = [sep2;sepe];
        
    end 
    
    if day == 3 
        
        sep3 = [sep3;year,month,day,var];
        
    end 
    
    a = isempty (sep3);
    
    if (a == 1)
        
        sep3 = [sep3;sepe];
        
    end 
    
    if day == 4 
        
        sep4 = [sep4;year,month,day,var];
        
    end 
    
    a = isempty (sep4);
    
    if (a == 1)
        
        sep4 = [sep4;sepe];
        
    end 
    
    if day == 5 
        
        sep5 = [sep5;year,month,day,var];
        
    end 
    
    a = isempty (sep5);
    
    if (a == 1)
        
        sep5 = [sep5;sepe];
        
    end 
    
    if day == 6 
        
        sep6 = [sep6;year,month,day,var];
        
    end 
    
    a = isempty (sep6);
    
    if (a == 1)
        
        sep6 = [sep6;sepe];
        
    end 
    
    if day ==  7
        
        sep7 = [sep7;year,month,day,var];
        
    end 
    
    a = isempty (sep7);
    
    if (a == 1)
        
        sep7 = [sep7;sepe];
        
    end 
    
    if day == 8
        
        sep8 = [sep8;year,month,day,var];
        
    end 
    
    a = isempty (sep1);
    
    if (a == 1)
        
        sep8 = [sep8;sepe];
        
    end 
    
    if day == 9 
        
        sep9 = [sep9;year,month,day,var];
        
    end 
    
    a = isempty (sep9);
    
    if (a == 1)
        
        sep9 = [sep9;sepe];
        
    end 
    
    if day == 10 
        
        sep10 = [sep10;year,month,day,var];
        
    end 
    
    a = isempty (sep10);
    
    if (a == 1)
        
        sep10 = [sep10;sepe];
        
    end 
    
    if day == 11
        
        sep11 = [sep11;year,month,day,var];
        
    end 
    
    a = isempty (sep11);
    
    if (a == 1)
        
        sep11 = [sep11;sepe];
        
    end 
    
    if day == 12
        
        sep12 = [sep12;year,month,day,var];
        
    end 
    
    a = isempty (sep12);
    
    if (a == 1)
        
        sep12 = [sep12;sepe];
        
    end 
    
    if day == 13 
        
        sep13 = [sep13;year,month,day,var];
        
    end 
    
    a = isempty (sep13);
    
    if (a == 1)
        
        sep13 = [sep13;sepe];
        
    end 
    
    if day ==  14
        
        sep14 = [sep14;year,month,day,var];
        
    end 
    
    a = isempty (sep14);
    
    if (a == 1)
        
        sep14 = [sep14;sepe];
        
    end 
    
    if day == 15
        
        sep15 = [sep15;year,month,day,var];
        
    end 
    
    a = isempty (sep5);
    
    if (a == 1)
        
        sep15 = [sep15;sepe];
        
    end 
    
    if day == 16 
        
        sep16 = [sep16;year,month,day,var];
        
    end 
    
    a = isempty (sep16);
    
    if (a == 1)
        
        sep16 = [sep16;sepe];
        
    end 
    
    if day == 17 
        
        sep17 = [sep17;year,month,day,var];
        
    end 
    
    a = isempty (sep17);
    
    if (a == 1)
        
        sep17 = [sep17;sepe];
        
    end 
    
    if day == 18
        
        sep18 = [sep18;year,month,day,var];
        
    end 
    
    a = isempty (sep18);
    
    if (a == 1)
        
        sep18 = [sep18;sepe];
        
    end 
    
    if day == 19 
        
        sep19 = [sep19;year,month,day,var];
        
    end 
    
    a = isempty (sep9);
    
    if (a == 1)
        
        sep19 = [sep19;sepe];
        
    end 
    
    if day == 20
        
        sep20 = [sep20;year,month,day,var];
        
    end 
    
    a = isempty (sep20);
    
    if (a == 1)
        
        sep20 = [sep20;sepe];
        
    end 
    
    if day ==  21
        
        sep21 = [sep21;year,month,day,var];
        
    end 
    
    a = isempty (sep21);
    
    if (a == 1)
        
        sep21 = [sep21;sepe];
        
    end 
    
    if day == 22
        
        sep22 = [sep22;year,month,day,var];
        
    end 
    
    a = isempty (sep22);
    
    if (a == 1)
        
        sep22 = [sep22;sepe];
        
    end 
    
    if day == 23
        
        sep23 = [sep23;year,month,day,var];
        
    end 
    
    a = isempty (sep23);
    
    if (a == 1)
        
        sep23 = [sep23;sepe];
        
    end 
    
    if day == 00 
        
        sep00 = [sep00;year,month,day,var];
        
    end 
    
    a = isempty (sep00);
    
    if (a == 1)
        
        sep00 = [sep00;sepe];
        
    end 
    
 
    

end 
    
        
        
        
        
        
        
        
