Converting values to g

Hello,
I need help converting values of an Accelerometer sensor. It has 12gb so the values are from 0 to 4096.
I need to convert a given "value" to g.
Having +-2g range I need to set 4096 to 2g and 0 to -2g to then plot the values.
Can you please help?
Thank you.

回答 (1 件)

Voss
Voss 2021 年 9 月 22 日
編集済み: Voss 2021 年 9 月 22 日

0 投票

g_val = double(val)/4096*4*g-2*g;
plot(g_val);

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

製品

リリース

R2021a

質問済み:

2021 年 9 月 22 日

編集済み:

2021 年 9 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by