%% Set Multiple Bits
% Set multiple bits to different values

bits = 2:6;
val = [1 0 0 1 1];
intout = bitset(0,bits,val,'int8')

% Copyright 2012 The MathWorks, Inc.