MATLAB: How to convert data with 3Dimensions to cell array

3dimension to cell array

I have a data A with 3D dimesions 2 x 5 x 2353 (double) and I would like to change it to the following
A=2353×1 cell
{2×5 double}
{2×5 double}
{2×5 double}
{2×5 double}
{2×5 double}
{2×5 double}
{… double}
Can I use Mat2Cell function ?

Best Answer

The simplest is:
B = num2cell(A, [1, 2]); %keep rows and columns together, split the pages
This will give you a 1x1x2353 cell array. If you do want a 2353x1 cell array permute the result:
B = permute(num2cell(A, [1, 2]), [3, 2, 1]);