Binary to Signed decimal in MATLAB
23 ビュー (過去 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!