function M_R = Mem_Radiation(body,n,L)

M_R = zeros(1,6);

if (n < 2)
    return;
end

dt = get(body,'dt');
xddot = get(body,'xddot');

tau = 0:dt:dt*(length(L{1,1})-1);


NN = min(n,length(tau));
Integrand = zeros(1,NN);

for i = 1:6
  M_R(i) = 0;  
  for j = 1:6
      for nn = 1:NN
      Integrand(nn) = xddot(n-nn+1,j)*L{i,j}(nn);
      end
    M_R(i) = M_R(i) + trapz(tau(1:NN),Integrand);
  end
end
  
