How can I list all properties of a dynamicprops object ?
Mostrar comentarios más antiguos
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
Respuestas (1)
Daniel Shub
el 24 de Oct. de 2011
Can you use: properties
doc properties
Starting from the MATLAB example:
obj = ObjArray;
addprop(obj, 'test');
properties(obj)
2 comentarios
Walter Roberson
el 24 de Oct. de 2011
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 ?
Daniel Shub
el 25 de Oct. de 2011
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).
Categorías
Más información sobre Properties en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!