Not sure if this is a complete answer, but it appears that invoking subsref directly requires a stricter definition of the output arguments. While:
will automatically dump all possible output arguments in a comma separated list, calling subsref directly requires you to explicitly define how many output arguments you want. The only way I've figured out thus far to get them all is to collect them in a cell array of the appropriate size:
>> [out{1:numel(A)}]=subsref(A, S)
out =
1×2 cell array
[1] [2]
>> [out{:}]
ans =
1 2
3 Comments
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/326156-why-is-subsref-and-subscripted-reference-not-equivalent#comment_430649
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/326156-why-is-subsref-and-subscripted-reference-not-equivalent#comment_430649
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/326156-why-is-subsref-and-subscripted-reference-not-equivalent#comment_430654
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/326156-why-is-subsref-and-subscripted-reference-not-equivalent#comment_430654
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/326156-why-is-subsref-and-subscripted-reference-not-equivalent#comment_430666
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/326156-why-is-subsref-and-subscripted-reference-not-equivalent#comment_430666
Sign in to comment.