lookupTable

版本 1.0.0.0 (935 字节) 作者: Dan Cohn
Creates a lookup table for a collection of key/value pairs
1.5K 次下载
更新时间 2008/3/31

无许可证

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

引用格式

Dan Cohn (2024). lookupTable (https://www.mathworks.com/matlabcentral/fileexchange/19381-lookuptable), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2008a
兼容任何版本
平台兼容性
Windows macOS Linux
致谢

启发作品: dict

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0

Improved function help and code readability