I have the following Matlab code to calculate a joint angle from 2 quaternions that only work with one row (in a spreadsheet). I want to use it for more than 1 row (for a matrix). How to change the code to get the result for all rows of the spreadsheet?

An=A/norm(A);

Bn=B/norm(B);

QuatDiff=quatmultiply(quatconj(An),Bn);

ang=2*atan2(norm(QuatDiff(2:4)),QuatDiff(1));

_________________________________________

A= sensor A quaternion and B=sensor B quaternion

Similar questions and discussions