%% Size Defined by Existing Array
% Define a 3-by-2 array A.

A = [1 4 ; 2 5 ; 3 6];

sz = size(A)

%
% Create an array of ones that is the same size as A

X = ones(sz)

% Copyright 2012 The MathWorks, Inc.