%% Complex One
% Create a scalar 1 that is not real valued, but instead is complex like an existing array.
% Define a complex vector.

p = [1+2i 3i];

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

X = ones('like',p)

% Copyright 2012 The MathWorks, Inc.