MATLAB: How to store cell arrays

cell arrays

If cell arrays contains matrices, what contains cell arrays? Is it possible to store different cell arrays into a single data set?
Eg.
A= {[1 2 3] [1 2] [3]
[1 ] [2 3] [1 2 3]};
B= {[4 5 6] [4 5] [6]
[4 ] [5 6] [4 5 6]};
C(1)=A
C(2)=B

Best Answer

You can put cell arrays into any container variables, in particular:
  • cell arrays
  • structures
Here are two cell arrays nested inside another cell array:
C{1} = {1,2,3};
C{2} = {'blue','anna'};
Note that cell arrays have two different kinds of indexing:
  1. {} curly braces are used to access the contents of the cells.
  2. () parentheses are used to reference the cells themselves.
See the MATLAB documentation: