Please, do not use isequal with floats, prefer instead abs(a-b) < tol. Notice how my solution used round and had to fix errors manually despite the operation being correct.
I tried the next function, but there is an error in the decimals. I got this result:
y_correct = [0.4347 0.7167
function Rotated_Vector = RotTimesVec(Rotation_Matrix,Vector)
[a,b,Dim] = size(Rotation_Matrix);
Rotated_Vector = ;
Ans = Vector(:,:,n)*Rotation_Matrix(:,:,n);
Rotated_Vector = [Rotated_Vector Ans'];
Back to basics 6 - Column Vector
Poker Series 08: IsPair
Angle between Two Vectors
Spot the outlier
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office