%
% Kronecker sum: X = A+B = (A*Im) + In*B
% X = ks(A,B);
%
%
function X = ks(A,B)
   [n,nt] = size(A); 
   [m,mt] = size(B);
   X = [];
   if n ~= nt
      disp('Square A is required');
      return
   end
   if m ~= mt
      disp('Square B is required');
      return
   end
   
   X = kp(A,eye(m)) + kp(eye(n),B);
end
