%% Next Power of 2 of Unsigned Integer Values
% Define a vector of unsigned integers and calculate the exponents for the next power of 2 higher than those values.

a = uint32([1020 4000 32700]);
p = nextpow2(a)

%
% Calculate the next powers of 2 higher than the values in a.

2.^p

% Copyright 2012 The MathWorks, Inc.