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. (seit R2022b)
Funktionen
dictionary | Object that maps unique keys to values (Seit R2022b) |
configureDictionary | Create dictionary with specified key and value types (Seit R2023b) |
insert | Add entries to a dictionary (Seit R2023b) |
lookup | Find value in dictionary by key (Seit R2023b) |
remove | Remove dictionary entries (Seit R2023b) |
entries | Key-value pairs of dictionary (Seit R2022b) |
keys | Keys of dictionary (Seit R2022b) |
values | Values of dictionary (Seit R2022b) |
types | Types of dictionary keys and values (Seit R2022b) |
numEntries | Number of key-value pairs in dictionary (Seit R2022b) |
isConfigured | Determine if dictionary has types assigned to keys and values (Seit R2022b) |
isKey | Determine if dictionary contains key (Seit R2022b) |
keyHash | Generate hash code for dictionary key (Seit R2022b) |
keyMatch | Determine if two dictionary keys are the same (Seit R2022b) |
Klassen
Themen
- Map Data with Dictionaries
Use dictionaries to store key-value pairs of different data types. (Seit R2022b)
- Dictionaries and Custom Classes
Modify custom classes for expected behavior in dictionaries.