You could also consider using a multidimensional array. Multidimensional arrays use memory more efficiently than cell arrays.
Be sure to pre-allocate the memory for the array you use, for performance reasons.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!