I'm surprise no one give you get an answer. There is some subttle internal working needed to be explained.
The syntax
The second command
call a graph method (probably an overloaded subsref) and it returns on the LHS multiple output IF LHS it's provided. If not the default LHS and Matlab ANS (single "variable"). However if users provide 2 LHS they'll get them.
>> [bb,cc] = G.Edges.Label{[2 3]}
bb =
'b'
cc =
'c'
>>
This behavior is very similar to any multiple-output function such as
>> [a,b]=meshgrid(1:3,1:2)
a =
1 2 3
1 2 3
b =
1 1 1
2 2 2
>> meshgrid(1:3,1:2)
ans =
1 2 3
1 2 3
To digest all that think about the following result
>> G.Edges.Label([2 3])
ans =
2×1 cell array
{'b'}
{'c'}
>> ans{:}
ans =
'b'
ans =
'c'
>>
2 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/587114-string-cell-array-inside-a-graph#comment_992462
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/587114-string-cell-array-inside-a-graph#comment_992462
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/587114-string-cell-array-inside-a-graph#comment_993476
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/587114-string-cell-array-inside-a-graph#comment_993476
Sign in to comment.