Containers Map saving more than one value
24 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Is there an alternative to a matlab containers Map which makes it possible to save more than one value for one key? I have data which is mostly one value to one key, but sometimes multiple values to one key. The number changes.
0 comentarios
Respuestas (1)
Adam
el 11 de Mzo. de 2019
Editada: Adam
el 11 de Mzo. de 2019
You can save a cell array or an object array as the 'value' for a given key if you set up the key type as 'any' (which is the default)
e.g.
m = containers.Map;
m( 'Matlab' ) = [27 28];
m( 'Stuff' ) = { 'some string', 'some other string', 45 }
0 comentarios
Ver también
Categorías
Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!