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

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

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

X = randn(size(A));

% Copyright 2012 The MathWorks, Inc.