Binary to Signed decimal in MATLAB
조회 수: 35 (최근 30일)
이전 댓글 표시
Hello,
I have a 64x1 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.
채택된 답변
Friedrich
2012년 5월 25일
Hi,
can't you simply do the inverse way to get it back? Or am I missing something here?
typecast(uint16(bin2dec('1000000000000000')),'int16')
추가 답변 (2개)
Titus Edelhofer
2012년 5월 25일
Hi,
then I guess the other way round should do the trick as well:
typecast(uint16(bin2dec('1000000000000000')), 'int16')
Titus
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!