Converting values to g

1 次查看(过去 30 天)
Nina Perf
Nina Perf 2021-9-22
编辑: Voss 2021-9-22
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
g_val = double(val)/4096*4*g-2*g;
plot(g_val);

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by