overload subsref locally in a function
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Is it possible to overload subsref locally in a function? I want to do it locally because the definition will involve calls to Matlab's subsref.
I tried:
a = [1 2 3];
subsref = @(varargin) disp('hello');
but a(1) doesn't output "hello".
I know this is a trivial example, but the actual goal is to define: subsref = @() SOMETHING-COMPLICATED and make use of the flexibility of the expression: a(1,2,:).field, instead of calling subsref(a,substruct(...)), which is complicated.
Thank you!
0 件のコメント
回答 (0 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!