开发者

writing LZW program in matlab

开发者 https://www.devze.com 2022-12-13 11:28 出处:网络
i\'m writing LZW in matlab,but i don\'t know 开发者_开发百科how i should make dictionary? i want some help in writing program.

i'm writing LZW in matlab,but i don't know 开发者_开发百科how i should make dictionary? i want some help in writing program. thanks


There is a containers.Map class available in newer verisons of MATLAB.

help containers.Map

should get you going.


if you can be guaranteed that the keys are alphanumeric, starting with a char, I would just use a struct to do the lookups. struct field -> value lookups are reasonably fast. if the keys are integers, I would use a sparse array to point to indices in a cell, but that will require more overhead.

0

精彩评论

暂无评论...
验证码 换一张
取 消