%% Clone Size from Existing Array
% Create a matrix of random numbers with the same size as an existing array.

A = [3 2; -2 1];
sz = size(A);
X = rand(sz)

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

X = rand(size(A));

% Copyright 2012 The MathWorks, Inc.