SHOW:
|
|
- or go back to the newest paste.
| 1 | a = [0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,1;1,0,0,0,0,0,0,0]; | |
| 2 | achar = cellfun(@(x) dec2bin(x)', mat2cell(a, ones(size(a,1),1), 8), 'UniformOutput', false); | |
| 3 | - | auint8 = cellfun(@(x) str2num(regexprep(x, '\d*', 'uint8($0)')), achar, 'UniformOutput', false); |
| 3 | + | auint8 = cellfun(@(x) uint8(bin2dec(x)), achar, 'UniformOutput', false); |