16 bit signed data to integer for analysis

조회 수: 3 (최근 30일)
Atique
Atique 2015년 9월 18일
댓글: Walter Roberson 2015년 9월 18일
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일
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개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by