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
0.2266 0.5861
0.3375 0.9331]
function Rotated_Vector = RotTimesVec(Rotation_Matrix,Vector)
[a,b,Dim] = size(Rotation_Matrix);
Rotated_Vector = [];
for n=1:Dim
Ans = Vector(:,:,n)*Rotation_Matrix(:,:,n);
Rotated_Vector = [Rotated_Vector Ans'];
end
end
Sort a list of complex numbers based on far they are from the origin.
4327 Solvers
Return a list sorted by number of occurrences
1504 Solvers
Arrange Vector in descending order
4076 Solvers
Find the largest value in the 3D matrix
1056 Solvers
180 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!