data.r = zeros(Nr,N_experiments,end_sample-start_sample+1);
data.u = zeros(Nu,N_experiments,end_sample-start_sample+1);
data.y = zeros(Ny,N_experiments,end_sample-start_sample+1);
for k_exp = 1:N_experiments
for k_real = 1:N_realizations
for nr = 1:Nr
data.r(nr, k_exp,1:(end_sample-start_sample+1),k_real) = R((((k_exp-1)*N_realizations+(k_real-1))*(end_sample-start_sample+1)+1):(((k_exp-1)*N_realizations+k_real)*(end_sample-start_sample+1)),nr)';
end
for nu = 1:Nu
data.u(nu, k_exp,1:(end_sample-start_sample+1),k_real) = U((((k_exp-1)*N_realizations+(k_real-1))*(end_sample-start_sample+1)+1):(((k_exp-1)*N_realizations+k_real)*(end_sample-start_sample+1)),nu)';
end
for ny = 1:Nu
data.y(ny, k_exp,1:(end_sample-start_sample+1),k_real) = Y((((k_exp-1)*N_realizations+(k_real-1))*(end_sample-start_sample+1)+1):(((k_exp-1)*N_realizations+k_real)*(end_sample-start_sample+1)),ny)';
end
end
end