When I have nested objects, changing the parameter of one object changes the same parameter in others
Afficher commentaires plus anciens
I am working with two handle classes, Class1 and Class2, defined as follows:
classdef Class1 < handle
properties
a = Class2;
end
end
classdef Class2 < handle
properties
b = 1;
end
end
If I create two separate instances of Class1 and adjust the value of parameter 'b' in the nested instance of Class2, the value of 'b' in both instances of Class 1 change. Is this supposed to happen?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Class Introspection and Metadata dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!