Accessing object B properties outisde of object A's getter method
6 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Alex Taylor
2012-4-3
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
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Classical Mechanics 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!