function PHI= phaseE(G)
%PHASE  Computes the phase of a complex vector 

[nr,nc] = size(G);
if min(nr,nc) > 1
    error(sprintf(['PHASE applies only to row or column vectors.'...
        '\nFor matrices you have to decide along which dimension the'...
        '\nphase should be continuous.']))
end
if nr>nc
    G = G.';
end
PHI=atan2(imag(G),real(G));

if nr>nc
    PHI = PHI.';
end