MATLAB: Binary to Signed decimal in MATLAB

binaryconversiondecimal 16 bits

Hello,
I have a 64×1 workspace variable,where each value is of 16 bits.
I need to convert each of them into signed decimal value, which would span the entire range of signed 16 bit numbers from -32768 to +32767.
I tried bin2dec() but it provides only an unsigned value.
Kindly help.

Best Answer

Hi,
can't you simply do the inverse way to get it back? Or am I missing something here?
typecast(uint16(bin2dec('1000000000000000')),'int16')