%% Clone Complexity from Existing Array
% Create a scalar 0 that is complex like an existing array instead of real valued.
% First, create a complex vector.

p = [1+2i 3i];

%
% Create a scalar 0 that is complex like p.

X = zeros('like',p)

% Copyright 2012 The MathWorks, Inc.