Error in comparing equal matrices
Afficher commentaires plus anciens
I am trying to display a success message if the code identifies two matrices which are equal, but I see that it works out only for a few elements of the matrices. Can anyone please correct me if wrong? Here is my code below:
Rotation_matrix = rotm2tform([0.9254 0.0180 0.3785; 0.1632 0.8826 -0.4410; -0.3420 0.4698 0.8138])
res = rpy2tr(30*pi/180,20*pi/180,10*pi/180)
if size(Rotation_matrix==res)
for i=1:size(Rotation_matrix)
for j=1:size(Rotation_matrix)
if Rotation_matrix(i,j)==res(i,j)
disp("success")
else
disp("fail")
end
end
end
else
disp("Sizes are not equal")
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Chebyshev dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!