Info

This question is closed. Reopen it to edit or answer.

zscore() kills vrrotvec()?

1 view (last 30 days)
Gabor Bekes
Gabor Bekes on 14 Sep 2016
Closed: MATLAB Answer Bot on 20 Aug 2021
Try the following: create an n x 3 matrix with randn(). Apply some oblique rotation to each of its rows.
a1 = randn(100,3);
a2 = (rot_mat*a1')';
Now, use vrrotvec() and vrrotvec2mat() to calculate which rotation matrix was used.
for ii = 1:100
rm1{ii} = vrrotvec2mat(vrrotvec(a1(ii,:),a2(ii,:)));
end
Now, visualize the created rotations somehow. You will see that the matrices vrrotvec() provided are not exactly close to each other (okay, they are completely off). Try shifting the means and increasing the standard deviation, for example like this:
a1 = bsxfun(@plus,a1,[0,5,10]);
a1 = bsxfun(@times,a1,[1,2,3]);
(You can also check the results with mean() and std().) If you repeat your matrix visualization (or compare numerically, like reshape them to row vectors and use uniquetol()), you will see that the accuracy of rotations given by vrrotvec() drastically improved. I presume this is some numerical issue.
Any comments, suggested workarounds are appreciated.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!