% zero padding matrix in the pixel domain
%
% Add zeros in each dimension.
%
% A = matZpad(sz,padupp,padlow)
%
% (c) by Hannes Nickisch, MPI for Biological Cybernetics, 2010 December 6

function A = matZpad(sz, padupp, padlow, complex)

  if nargin<2, padupp = sz*0; end, A.padupp = padupp;
  if nargin<3, padlow = sz*0; end, A.padlow = padlow;
  A.imsz = sz; sz = [prod(A.imsz+padlow+padupp), prod(A.imsz)];
  if nargin<4, complex = 1; end
  if numel(complex)==1, complex = complex*[1,1]; end
  
  A = class(A,mfilename,mat(sz,complex));
