Accessing object B properties outisde of object A's getter method
Afficher commentaires plus anciens
I am trying to implement an object with dependent properties and therefore have a getter method to dynamically access these properties. However, I am having trouble with implementation once the properties are dependent on properties of objects outside of the particular class. EX
classdef objA
properties (Dependent)
propA
end
methods
propA = get.propA(objA)
propA = objA.propA * propB.value;
end
Réponses (1)
Alex Taylor
le 3 Avr 2012
Sounds like your class objA should define a property that holds the object(s) you need to define your get operation.
classdef objA
properties (Dependent)
propA
propB
end
methods
propA = get.propA(objA)
propA = objA.propA * propB.value;
end
1 commentaire
gareth
le 3 Avr 2012
Catégories
En savoir plus sur Create Fixed-Point Objects in MATLAB dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!