find something strange when using rot90. the matrix are not equal nor equal. In this case 33 appears in the answer.
Mostrar comentarios más antiguos
A=randi(2,3,3);
B=rot90(A);
if A==B
11
elseif A~=B
22
else
33
end
Respuesta aceptada
Más respuestas (1)
Dishant Arora
el 11 de Mzo. de 2014
A and B are matrices not scalar compare them using isequal. Try this
if isequal(A,B)
% do something
elseif ~isequal(A,B)
% do something
And to know what you did wrong in your code type this:
A==B
1 comentario
Henry
el 11 de Mzo. de 2014
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!