Main Content

Dictionaries

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)

Functions

dictionaryObject that maps unique keys to values (Since R2022b)
configureDictionaryCreate dictionary with specified key and value types (Since R2023b)
insertAdd entries to a dictionary (Since R2023b)
lookupFind value in dictionary by key (Since R2023b)
removeRemove dictionary entries (Since R2023b)
entriesKey-value pairs of dictionary (Since R2022b)
keysKeys of dictionary (Since R2022b)
valuesValues of dictionary (Since R2022b)
typesTypes of dictionary keys and values (Since R2022b)
numEntriesNumber of key-value pairs in dictionary (Since R2022b)
isConfiguredDetermine if dictionary has types assigned to keys and values (Since R2022b)
isKeyDetermine if dictionary contains key (Since R2022b)
keyHashGenerate hash code for dictionary key (Since R2022b)
keyMatchDetermine if two dictionary keys are the same (Since R2022b)

Classes

expand all

containers.MapObject that maps unique keys to values

Topics