%covz.m                                                Steve Mann, 2000
%
%covariance real and imag parts of complex valued vector
%
%example uses: covz0 = covz(z);
%see also mulz.m

function C = myfunction(z)

if nargin ~= 1
  error('must have exactly 1 input argument')
end%if

if min(size(z))>1
  error('input must be a vector')
end%if

x=real(z); y=imag(z); zxy=[x y];

%mycov = zxy.'*zxy;
%q=inv(chol(mycov))
%zq=zxy*q;
%zq'*zq % is now the identity matrix

C = cov(zxy);

