Nested maps in MATLAB

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 日

0 投票

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);

カテゴリ

ヘルプ センター および File ExchangeVehicle Scenarios についてさらに検索

質問済み:

2013 年 11 月 14 日

回答済み:

2017 年 4 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by