%% Computation Resulting in Zero-Valued Imaginary Part
% Define two complex scalars, x and y.

x=3+4i;
y=5-4i;

%
% Determine whether the addition of two complex scalars, x and y, is real.

A = x+y

% MATLAB® drops the zero imaginary part.
%

isreal(A)

% A is real since it does not have an imaginary part.
% Copyright 2012 The MathWorks, Inc.