Overload subsref for getting and setting static properties
1 次查看(过去 30 天)
显示 更早的评论
If I have written a class MyClass, I can customize the behavior of expressions such as a.myProperty, a(4) where a is an instance of MyClass. As described in the documentation I do this by overloading subsref for MyClass.
But how can I in a similar way customize the behavior of the same operations applied to classes instead of class instances?
That is, how can I redefine the behavior of for example:
p = MyClass.MyStaticProperty;
Is there a static method equivalent to subsref?
Best regards, Joel
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call C++ from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!