Nested maps in MATLAB
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (1)
Roland
le 10 Avr 2017
There is a new MapNested class on Matlabs File-exchange: http://de.mathworks.com/matlabcentral/fileexchange/62492-mapnested-implementation-for-nested-maps--map-of-maps-
or on github:
https://github.com/RolandRitt/Matlab-NestedMap Check it out!
The syntax for setting an value is the following:
NMapobj = MapNested(); %constructor;
NMapobj(key1, key2, key3) = value;
for retrieving:
value = NMapobj(key1, key2, key3);
0 commentaires
Voir également
Catégories
En savoir plus sur Dictionaries dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!