lookupTable

Versione 1.0.0.0 (935 Byte) da Dan Cohn
Creates a lookup table for a collection of key/value pairs
1,5K download
Aggiornato 31 mar 2008

Nessuna licenza

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'}

Cita come

Dan Cohn (2026). lookupTable (https://it.mathworks.com/matlabcentral/fileexchange/19381-lookuptable), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2008a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Riconoscimenti

Ispirato: dict

Versione Pubblicato Note della release
1.0.0.0

Improved function help and code readability