vect = [0 1 1 1 0 1 0 0]; code = 0; for i = 1:8 if (vect(i) > 0) code += 2^(8-i); end end theChar = char(code)
char(sum(vect.*(2.^[7:-1:0])))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)