function A=DirectSum(A,varargin)
% DIRECTSUM computes the direct sum of matrices
%   A=DirectSum(A1,A2,...,An) computes the direct sum of matrices of
%   arbitrary size (Peter Arbenz, May 30, 1997)

for k=1:length(varargin)
  [n,m]=size(A);
  [o,p]=size(varargin{k});
  A=[A zeros(n,p); zeros(o,m) varargin{k}];
end
