%% Phase Angles of Matrix Elements
% Create a matrix of complex values and compute the phase angle of each element.

Z = [1 - 1i   2 + 1i   3 - 1i   4 + 1i
     1 + 2i   2 - 2i   3 + 2i   4 - 2i
     1 - 3i   2 + 3i   3 - 3i   4 + 3i
     1 + 4i   2 - 4i   3 + 4i   4 - 4i];

P = angle(Z)

% Copyright 2012 The MathWorks, Inc.