![]() |
Exploiting MATLAB's Data Structures |
Cell arrays are arrays where the elements are other arrays. This allows you to collect arrays of different types and sizes together. A common use of the cell array is to store strings (which may have different lengths) in the elements of a cell array.
Problem #1 - Rank of Magic Squares
Problem #2 - Cell Array of Strings
| cell | Create cell array |
| deal | Deal input to outputs |
| num2cell | Convert numeric array to cell |
To convert cells to numbers when all the numbers are the same size, the
easiest is to use comma separated list expansion with [ ] or cat. ![]()
Copyright © 1997 The MathWorks, Inc.
clay@mathworks.com
$Revision$ $Date$