Matlab Class property sharing between different classes
显示 更早的评论
Hello everyone,
I have two different class implementations:
classdef X classdef Y
properties properties
a a
b c
end end
... ...
end end
I create an object from X and an object from Y. Then, I need the memory to be shared between X.a and Y.a such that if I update X.a, I want Y.a to be updated, not the other properties (b and c) be afffected. I tried different techniques such as creating handle classes for X and Y and made an equality equation such that
X.a = Y.a ;
However, the memory addresses are not shared, only the value is copied from Y class to the X class. If I change X there is no effect on Y class.
What is the method for sharing the memory of properties between different classes?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Class Introspection and Metadata 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!