MATLAB: Can anyone tell how to add ‘space’ in the library for the lzw compression technique

lzw compressionMATLAB

original:
after decompression:
as you can see the for the decompression the the space is not included in the paragraph can anyone tell me what should be include in the library for including space in the paragraph

Best Answer

LZW as a class of algorithms does not treat spaces as anything different from any other characters.
The bug is on line 17 of your code. Unless, that is, that line contains the character 'u': if it does then the bug is on line 25.