function C=boxmin(A,B)

C=+inf*ones(size(A,1),size(B,2));

for l=1:size(A,2)
   for j=1:size(B,2)         
      C(:,j)=min(C(:,j),A(:,l)+B(l,j));
   end
end

         