C{2,1}{2,2} = {pi, eps};
C{2,2}.Field3 = struct('NestedField1', rand(3), ...
'NestedField2', magic(4), ...
'NestedField3', {{'text'; 'more text'}} );
Access parts of the new data using curly braces, smooth parentheses, or dot notation.
copy_pi = C{2,1}{2,2}{1,1}
copy_pi = 3.1416
part_magic = C{2,2}.Field3.NestedField2(1:2,1:2)
part_magic = 2×2
16
2
5
11
nested_cell = C{2,2}.Field3.NestedField3{2,1}
nested_cell =
'more text'
See Also
Related Examples
•
“Access Data in Cell Array” on page 12-5
Multilevel Indexing to Access Parts of Cells
12-21
Précédent

- 557/1450

Suivant