Calculate the resultant vector for 3 axis of data

67 vues (au cours des 30 derniers jours)
Katrina Anderson
Katrina Anderson le 4 Sep 2018
Commenté : Samuel Louise le 28 Jan 2019
I have an 9 axis sensor and I have the data in matlab. I am wanting to calculate the resultant vector of acceleration, the resultant angular velocity for gyroscope.. and magnetometer.
In excel i would simply SQRT(accx^2+accy^2+accz^2) . this would be the resultant.
My question is how do i calculate this? Then, how do I automatically calculate this for every data point?
  1 commentaire
Samuel Louise
Samuel Louise le 28 Jan 2019
Hi I am just wondering which MPU you are using for reading the data because i am having difficulties to read data out of the MPU 9250?
Thank you
From SAM

Connectez-vous pour commenter.

Réponse acceptée

KSSV le 4 Sep 2018
% some random data for demo
accx = rand(10,1) ;
accy = rand(10,1) ;
accz = rand(10,1) ;
R = sqrt(accx.^2+accy.^2+accz.^2) ;
  3 commentaires
Katrina Anderson
Katrina Anderson le 6 Sep 2018
ok thankyou, that makes sense. It worked perfectly!

Connectez-vous pour commenter.

Plus de réponses (0)


En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by