%% Convert Numeric Data Type
% Convert int8 values to uint8.
% Define a vector of 8-bit integers.

a = int8([-5 5]);

% Convert a to unsigned 8-bit integers. The –5 value outside the range of uint8 is truncated to 0.

b = cast(a,'uint8')

%
% Copyright 2012 The MathWorks, Inc.