%% Complex Identity Matrix
% Create a 2-by-2 identity matrix that is not real valued, but instead is complex like an existing array.
% Define a complex vector.

p = [1+2i 3i];

%
% Create an identity matrix that is complex like p.

I = eye(2,'like',p)

% Copyright 2012 The MathWorks, Inc.