Converting values to g

3 vues (au cours des 30 derniers jours)
Nina Perf
Nina Perf le 22 Sep 2021
Modifié(e) : Voss le 22 Sep 2021
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.

Réponses (1)

Voss
Voss le 22 Sep 2021
Modifié(e) : Voss le 22 Sep 2021
g_val = double(val)/4096*4*g-2*g;
plot(g_val);

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by