user227929
user227929

Reputation:

writing LZW program in matlab

i'm writing LZW in matlab,but i don't know how i should make dictionary? i want some help in writing program. thanks

Upvotes: 1

Views: 747

Answers (2)

shabbychef
shabbychef

Reputation: 1999

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.

Upvotes: 0

Hannes Ovrén
Hannes Ovrén

Reputation: 21851

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

help containers.Map

should get you going.

Upvotes: 2

Related Questions