Overload subsref for getting and setting static properties
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Joel Andersson
le 14 Avr 2014
Réponse apportée : Joel Andersson
le 15 Avr 2014
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
2 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Construct and Work with Object Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!