MATLAB: From a cell to an array (besides cell2mat)

arrayscellcellsMATLABmatrix

Let's say I have a cell called path, which consists of the following, for illustration purposes, [0] [1×2] [1×3].
Is there any way to transform it into a normal array, such that if I wanted to access, for example, path(1) = 0, path(2) = 1 2 and path(3) = 4 5 6 ( the values are just for illustration purposes).
Thanks for the help in advance.

Best Answer

If all cells have a 1xN dimension, concatenation into a single row using comma-separate list expansion should work:
C = {[1] [2 3] [4 5 6]}
M = cat(2, C{:})