MATLAB: I need shannon fano code. im new, please help me

fanoshannonshannon fano

for example :
M1 0.4 = 0
M2 0.3 = 10
M3 0.2 = 110
M4 0.1 = 111
Related Question