clear all; close all; clc;
qa = quantizer ('ufixed','round', 'saturate',[8 0]);
qi = quantizer ('ufixed','round', 'saturate',[8 7]);
qo = quantizer ('ufixed','round', 'saturate',[12 11]);
textfile = 'LUT_values8to12.txt'; 
fid = fopen (textfile, 'wt'); % generates text file in write mode

for j = 1:3
for i = 1:256     
        a=num2hex(qa,i-1);
        b=hex2num(qi,a);
        if j == 1
            val1= b^0.8; 
        elseif j==2
            val1= b^0.49; 
        else
            val1= b^0.23;
        end
        val1h = num2bin(qo, val1); 
        fprintf(fid, '%s\n',val1h); 
end
end

fclose (fid); 