|Programming and Data Types|
Obtaining Data from Cell Arrays
You can obtain data from cell arrays and store the result as either a standard array or a new cell array. This section discusses:
Accessing Cell Contents Using Content Indexing
You can use content indexing on the right side of an assignment to access some or all of the data in a single cell. Specify the variable to receive the cell contents on the left side of the assignment. Enclose the cell index expression on the right side of the assignment in curly braces. This indicates that you are assigning cell contents, not the cells themselves.
Consider the 2-by-2 cell array
You can obtain the string in
In assignments, you can use content indexing to access only a single cell, not a subset of cells. For example, the statements |
To obtain subsets of a cell's contents, concatenate indexing expressions. For example, to obtain element
(2,2) of the array in cell
Accessing a Subset of Cells Using Cell Indexing
Use cell indexing to assign any set of cells to another variable, creating a new cell array. Use the colon operator to access subsets of cells within a cell array.
|Creating Cell Arrays||Deleting Cells|