%% Create Cell Array of Numeric Arrays
% Generate a 4-by-3-by-2 numeric array, and then create a 1-by-3-by-2 cell array of 4-by-1 column vectors.

A = reshape(1:12,4,3);
A(:,:,2) = A*10
C = num2cell(A,1)

%
% Each 4-by-1 vector contains elements from along the first dimension of A:

C{1}

%
% Create a 4-by-1-by-2 cell array of 1-by-3 numeric arrays.

C = num2cell(A,2)

%
% Each 1-by-3 row vector contains elements from along the second dimension of A:

C{1}

%
% Finally, create a 4-by-3 cell array of 1-by-1-by-2 numeric arrays.

C = num2cell(A,3)

%
% Each 1-by-1-by-2 vector contains elements from along the third dimension of A:

C{1}

% Copyright 2015 The MathWorks, Inc.