I am trying to figure out how to encode integers based on given parameters. For example, I am given the table:
integer = 0, encoding is 3294
integer = 1, encoding is 128
integer = 2, encoding is 2098
etc.
How would I go about doing this? I have looked at the function dec2bin, but it's not exactly what I need. My input would be a vector, say x = [ 2 1 0 ]
and the output would be the vector y = [2 0 9 8 1 2 8 3 2 9 4]
.
Any advice or help is appreciated!