How to get multiple outputs from SUBSREF call when accessing cell array?
이전 댓글 표시
Consider the following example, where I access all contents of a cell array directly, e.g.
>> c = {'A','B'}
c =
1×2 cell array
{'A'} {'B'}
>> c{:}
ans =
'A'
ans =
'B'
This returns both elements, whereas an access via subsref and trying to capture both results in a cell returns the first element only, e.g.
>> subStr = substruct('{}',{':'});
>> subsref(c,subStr)
ans =
'A'
How can I get multiple outputs from subsref call when accessing a cell array?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Customize Object Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!