https://fr.mathworks.com/help/comm/ref/arithenco.html
arithenco - Encode sequence of symbols by arithmetic encoding - MATLAB
This MATLAB function generates the binary arithmetic code corresponding to the sequence of symbols specified in seq.
encodesequencesymbolsarithmeticencoding