% Extract imaginary part of a complex vector
%
% A = matImag(sz)
%
% The operation is not linear in IC^n but in the embedding space IR^n only.
%
% (c) by Hannes Nickisch, MPI for Biological Cybernetics, 2010 December 17

function A = matImag(sz, complex)

  A.imsz = sz; sz = prod(A.imsz)*[1,1];
  if nargin<2, complex = 1; end
  if numel(complex)==1, complex = complex*[1,1]; end

  A = class(A,mfilename,mat(sz,complex));