Main Content


Map data with keys that index values

A dictionary is a data structure that associates each key with a corresponding value. Keys and values can be of any data type, providing more flexibility for data access than array indices and improved performance.

dictionary is recommended over containers.Map because it supports more data types as keys and values and provides better performance. (since R2022b)


dictionaryObject that maps unique keys to values
entriesKey-value pairs of dictionary
keysKeys of dictionary
valuesValues of dictionary
typesTypes of dictionary keys and values
numEntriesNumber of key-value pairs in dictionary
isConfiguredDetermine if dictionary has types assigned to keys and values
isKeyDetermine if dictionary contains key
keyHashGenerate hash code for dictionary key
keyMatchDetermine if two dictionary keys are the same


expand all

containers.MapObject that maps unique keys to values