%% Clone Size from Existing Array
% Create an array of NaN values that is the same size as an existing array.

A = [1 4; 2 5; 3 6];
sz = size(A);
X = NaN(sz)

% It is a common pattern to combine the previous two lines of code into a single line.

X = NaN(size(A));

% Copyright 2018 The MathWorks, Inc.