Locate all the nested properties of a certain class

2 vues (au cours des 30 derniers jours)
Joan Vazquez
Joan Vazquez le 14 Juil 2020
I have a "huge" object with lots of nested properties, and I would like to locate all the instances of a certain class within the properties.
For example, in pseudocode, I am looking for something like the function findClassWithinObject below:
hugeobject = HugeObject()
targetclass = 'TargetClass'
findClassWithinObject(hugeobject, targetclass)
% Returns: {hugeobject.level1property1.level1property2, hugeobject.level1property100}
% Which are properties whose class is TargetClass
If returning "all" the properties is too much, finding a single instance of the TargetClass would already help me navigate the codebase.
Thanks

Réponses (0)

Catégories

En savoir plus sur Construct and Work with Object Arrays dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by