I have a cell array with a variable number of cells and a variable number of elements within each cell. For instance, it could by V{1}{1}=1 2 3 4, V{1}{2}=3 4 1 0,V{1}{3}=3 5 -1 -9, and V{2}{1}=-1 -2 9, V{2}{2}= 0 9 6, i.e., the cell 1 has 3 vectors of length 4 elements and the cell 2 has 2 vectors of length 3. I want to construct another cell array such that it has all combinations of these vectors, here I could have 6 combinations (3*2=6). The new cell array has to be of length 6 cells (number of possible combinations), and each cell has a possible combinations, for example A{1}={1 2 3 4 and -1 -2 9} and A{2}={1 2 3 4 and 0 9 6} . Note that I will get these vectors from a matlab code so I do not know them in advance.
MATLAB: How to construct a cell array from another cell array
cell arrayindexingpermutation
Related Question
- Concatenation is missing values
- Combine a cell array of cell arrays to a cell array of numbers
- Newbie to Matlab: How to find duplicates within a cell of arrays, arrays have varying sizes
- Group every ten cell array
- Loop over a cell and combine cell columns into one column
- Create a 3D cell with vector elements of size 1×5 from five 3D matrices
- Concatenating cell array elements
Best Answer