Using containers.Map as a Class's property
古いコメントを表示
I am having a problem in Matlab while using container.Map as a property of a class. I have a class Sensor with one property which is an object of containers.Map. The problem is, I cannot modify this property for one Sensor object without modifying map in other Sensor object. This property looks to be shared among objects of class Sensor. See below for explanation.
classdef Sensor
properties
id
map=containers.Map;
end
end
s1=Sensor;
s2=Sensor;
s1.map('key1')='value1';
s2.map
At this point s2.map also has same content as s1.map.
Has anyone faced this before or any particular solution. I just changed from table to containers.Map because of the flexibility and speed.
Thanks Saurav
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!