>> help reinterpretcast
reinterpretcast Convert fixed-point or integer data types without changing underlying data
C = reinterpretcast(A, T) converts the input (integer or fi object) A
to the data type specified by numerictype object T, without changing
the underlying (stored integer) data. The result is returned in C.
The data type of the input A must be fixed point or integer. T must be
a numerictype object with a fully specified fixed-point data type. The
word length of inputs A and T must be the same.
The reinterpretcast function differs from the MATLAB TYPECAST and CAST
functions, in that it only operates on fi and integer types, and it
does not allow the word length of the input to change.
EXAMPLE:
a = fi([-1 pi/4], true, 8, 7)
T = numerictype(false, 8, 0);
b = reinterpretcast(a, T)
binary_rep = [bin(a);bin(b)]
Best Answer