containers.Map
Object that maps unique keys to values
Description
A Map
object is a data structure that allows you to
retrieve values using a corresponding key. Keys can be real numbers or character
vectors. As a result, they provide more flexibility for data access than array indices,
which must be positive integers. Values can be scalar or nonscalar
arrays.
Creation
Syntax
Description
Note
dictionary
is recommended over containers.Map
because it accepts more data types as keys and values and provides better
performance. (since R2022b)
M = containers.Map(
,
where keySet
,valueSet
,'UniformValues',isUniform
)isUniform
is false
, specifies that
the values in valueSet
do not need to be uniform. The default
value of isUniform
is true
. The values in
valueSet
are uniform when they are all scalars that have
the same data type, or when they are all character vectors.
M = containers.Map
creates an empty
Map
object.
Input Arguments
Properties
Object Functions
Examples
Extended Capabilities
Version History
Introduced in R2008b