How can I list all properties of a dynamicprops object ?

I need to list all the properties of an object with dynamic properties (dynamicprops). I specially have trouble getting a list of all the addprop()'ed properties...
thanks in advance

Réponses (1)

Can you use: properties
doc properties
Starting from the MATLAB example:
obj = ObjArray;
addprop(obj, 'test');
properties(obj)

2 commentaires

Daniel, was it you that was struggling with scoping of properties a month or so ago? An issue about public vs private properties?
Anyhow, I just wonder if that is an issue in this present situation: if someone a dynamically added property was marked private, then logically one should not be able to "see" that property from outside the class. I cannot tell whether Agonzalez is trying to work from inside or outside of the classdef ?
Good point. I am not sure why you would want to, or even if you could, use a private dynamic property, but a more robust solution might be to use metaclass(obj).

Connectez-vous pour commenter.

Catégories

Produits

Question posée :

le 23 Oct 2011

Community Treasure Hunt

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

Start Hunting!

Translated by