



clc;
clear;
close all;

%load LOG_DATA_12_2494.mat;
load LOG_DATA_11_2494.mat;
%load LOG_DATA_12_1648.mat;


N=4;
t=0;   %t può essere solo negativo
y=1;
J=10;
%v=[temperature1 humidity2 humidity_true3 activieRadiotion4 totalRadiation5]
v=[ 1 1 0 0 0];

for i=1:length(log)
   log_temp(i).temperature=log(i).temperature;
   log_hum(i).humidity=log(i).humidity;
   log_hum_real(i).humidity_true=log(i).humidity_true;
   log_rad(i).activeRadiation=log(i).activeRadiation;
   log_rad_tot(i).totalRadiation=log(i).totalRadiation;
   
end

if y<1;                                 y=1;
elseif y>length(log);                   y=length(log_temp);  
end



A=[];


for i=1:length(log_temp)
   if i==y
   else
       A_tmp=[];

       for j=1:N
        A_tmp=[A_tmp ; log_temp(i).temperature(abs(t-j-2):abs(t-j-2)+J-1)'];
       end

       A=[A A_tmp];
   end   
end


if v(2)==1
    for i=1:length(log_temp)
           A_tmp=[];

           for j=1:N
            A_tmp=[A_tmp ; log_hum(i).humidity(abs(t-j-2):abs(t-j-2)+J-1)'];
           end

           A=[A A_tmp];
    end
end

if v(3)==1
    for i=1:length(log_temp)
           A_tmp=[];

           for j=1:N
            A_tmp=[A_tmp ; log_hum_real(i).humidity_true(abs(t-j-2):abs(t-j-2)+J-1)'];
           end

           A=[A A_tmp];
    end
end

if v(4)==1
    for i=1:length(log_temp)
           A_tmp=[];

           for j=1:N
            A_tmp=[A_tmp ; log_rad(i).activeRadiation(abs(t-j-2):abs(t-j-2)+J-1)'];
           end

           A=[A A_tmp];
    end
end

if v(5)==1
    for i=1:length(log_temp)
           A_tmp=[];

           for j=1:N
            A_tmp=[A_tmp ; log_rad_tot(i).totalRadiation(abs(t-j-2):abs(t-j-2)+J-1)'];
           end

           A=[A A_tmp];
    end
end


%aggiunta di y
for i=1:length(log_temp)
   if i==y
       A_tmp=[];

       for j=1:N
        A_tmp=[A_tmp ; log_temp(i).temperature(abs(t-j-2):abs(t-j-2)+J-1)'];
       end

       A=[A A_tmp];
   end   
end

