function retval = test_bin2dec (d) % retval = cellfun(binchar2dec, d); retval = cellfun('binchar2dec', d); endfunction function retval = binchar2dec(s) s = s(!isspace(s)); retval = (s-'0')*power(2,[0:length(s)-1]'); endfunction