Graphics Programs Reference
In-Depth Information
To index nested cell arrays, use as many sets of curly brackets { and
} as needed to get you to the level of nesting required, then use round
brackets ( and ) to access their contents. For example:
>> tt = {t {'Barney Rubble' {[-1 1] , 'Bedrock'}}}
tt =
{1x2 cell}
{1x2 cell}
>> cellplot(tt)
>> tt{2}
ans =
'Barney Rubble'
{1x2 cell}
>> tt{2}{2}
ans =
[1x2 double]
'Bedrock'
>> tt{2}{2}{1}
ans =
-1 1
>> tt{2}{2}{2}
ans =
Bedrock
>> tt{2}{2}{1}{2}
??? Cell contents reference from a non-cell array object.
>> tt{2}{2}{1}(2)
ans =
1
Exercise 11 Do you know where the word “ stuck ” has come
from in the following example (answer on page 189):
Search WWH ::




Custom Search