16 bit signed data to integer for analysis

Hi, I am trying to convert 16 bit signed data from my machine to convert to radians. I am a bit confused as to how I can convert per say +1024 into 2pi and -1024 into -2pi. Is there a function that can first convert the 16bit signed data into real number for me?
Thanks, Atique

 採用された回答

Walter Roberson
Walter Roberson 2015 年 9 月 18 日
編集済み: Walter Roberson 2015 年 9 月 18 日

0 投票

double(X)/1024 * 2*pi
However, normally angles are in the range -Pi to +Pi or 0 to 2*Pi. If you wanted -1024 to correspond to -Pi and +1024 to correspond to +Pi then change the 2*pi above to just pi

2 件のコメント

Atique
Atique 2015 年 9 月 18 日
Thanks! I didn't realize there was no conversion needed!
Walter Roberson
Walter Roberson 2015 年 9 月 18 日
double() does conversion.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by