lookupTable
Keine Lizenz
Creates a lookup table for a collection of key/value pairs. Keys can be ANY data-type (although indexing over function handles might produce unexpected/incorrect behavior)
Examples:
weatherStruct = struct('clouds','rain','windy','cold');
obj = weatherObject(weatherStruct,...);
tbl = lookupTable('today''s weather', weatherStruct,obj,'found weather obj',0.0123,'random data here');
A = tbl('today''s weather')
= weatherStruct
A = tbl(obj)
= 'found weather obj'
A = tbl(0.0123)
= 'random data here'
k = tbl.key(1) %equal to first element of key
= 'today''s weather'
v = tbl.value(2) %equal to second element of value
= 'found weather obj'
key = tbl.contents('-key')
= {'today''s weather',obj,123}
value = tbl.contents('-value')
= {weatherStruct,'found weather obj','random data here'}
Zitieren als
Dan Cohn (2025). lookupTable (https://de.mathworks.com/matlabcentral/fileexchange/19381-lookuptable), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxKategorien
- MATLAB > Language Fundamentals > Data Types > Tables >
- MATLAB > Language Fundamentals > Data Types > Structures >
- MATLAB > Language Fundamentals > Data Types > Cell Arrays >
- MATLAB > Language Fundamentals > Data Types > Function Handles >
- MATLAB > Language Fundamentals > Data Types > Dictionaries >
Tags
Quellenangaben
Inspiriert: dict
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.0.0 | Improved function help and code readability |
