Nested maps in MATLAB

조회 수: 23 (최근 30일)
Mehdi
Mehdi 2013년 11월 14일
답변: Roland 2017년 4월 10일
I know it is possible to create a map within another map. For example, I can have:
mpMainMap = containers.Map();
mpMain('Key1') = containers.Map('Key2',2);
Is there any way to access the values of the second map directly (ie. without assigning it to a temporary variable first).
Any information is appreciate. Thanks

답변 (1개)

Roland
Roland 2017년 4월 10일
or on github:
The syntax for setting an value is the following:
NMapobj = MapNested(); %constructor;
NMapobj(key1, key2, key3) = value;
for retrieving:
value = NMapobj(key1, key2, key3);

카테고리

Help CenterFile Exchange에서 Dictionaries에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by