clc;
clear all;
close all;

 

 
load LOG_DATA_11_2494.mat;
U=[];
v=[ 1 1 0 1 0];
num_sign_div=sum(v);  %
l=length(log);

 
if v(1)==1    
    for i=1:l;
        U = [ U , log(i).temperature];
    end
end
if v(2)==1    
    for i=1:l;
        U = [ U , log(i).humidity];

 
    end
end
if v(3)==1
    for i=1:l;
        U = [ U , log(i).humidity_true];
    end
end
if v(4)==1
    for i=1:l;
        U = [ U , log(i).activeRadiation];

 
    end
end
if v(5)==1    
    for i=1:l;
        U = [ U , log(i).totalRadiation];
    end
end

 

 

 
Ts=60*8;

 

 
Usize=size(U);

 
start_index_id=100;
stop_index_id=1100;

 

 
%ciclo temperatura
for i=1:Usize(2)/num_sign_div

    
    Dati(i).ytemp=U(:,i);
    Dati(i).yhum=U(:,Usize(2)/num_sign_div+i);

    

    
    Dati(i).Udati_pery=cancel_y_from_U(U,i);

    
    Dati(i).Udati_perh=cancel_y_from_U(U,Usize(2)/num_sign_div+i);

    
end

 

 
for i=1:Usize(2)/num_sign_div 

 
    [ Dati(i).id_t.Mnpf , Dati(i).id_t.iperf , Dati(i).id_t.Mnpe , Dati(i).id_t.ipere ] = ...
       stimanonparametrica( Dati(i).ytemp ( start_index_id : stop_index_id ) , ... 
                            Dati(i).Udati_pery( start_index_id : stop_index_id ));
    [ Dati(i).id_h.Mnpf , Dati(i).id_h.iperf , Dati(i).id_h.Mnpe , Dati(i).id_h.ipere ] = stimanonparametrica(Dati(i).yhum(start_index_id:stop_index_id)  , Dati(i).Udati_perh(start_index_id:stop_index_id));

 
end