%% Test Complex Numbers
% Create a vector of complex numbers.

A = [1+i 2-2i 1+3i 1-2i 5-i];

%
% Find the values that are greater than 2.

A(A > 2)

% gt compares only the real part of the elements in A.
%
% Use abs to find which elements are outside a radius of 2 from the origin.

A(abs(A) > 2)

% The result has more elements since abs accounts for the imaginary part of the numbers.
% Copyright 2012 The MathWorks, Inc.