Guest User

regexprep_uint8

a guest
Mar 29th, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
Advertisement
Add Comment
Please, Sign In to add comment