Containers Map saving more than one value

조회 수: 5 (최근 30일)
Jennifer Sander
Jennifer Sander 2019년 3월 11일
편집: Adam 2019년 3월 11일
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.

답변 (1개)

Adam
Adam 2019년 3월 11일
편집: Adam 2019년 3월 11일
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 }

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by