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

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

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

X = zeros(size(A));

% Copyright 2012 The MathWorks, Inc.