MATLAB Answers

i want to compare between 3 matrices

4 views (last 30 days)
Hassan Bosha
Hassan Bosha on 6 Apr 2020
Commented: Hassan Bosha on 6 Apr 2020
I have an equation that i have 3 matrices
i should compare to each other with an if statment
I1 and I2 are matrices
plus what if i want to compare I1 == I2 == I3
if true i would print something
if I1 == I2
disp('I1 = I2')
end

Answers (1)

Alex Mcaulley
Alex Mcaulley on 6 Apr 2020
Use isequal:
if isequal(I1,I2,I3)
disp('I1 == I2 == I3')
end
  2 Comments
Hassan Bosha
Hassan Bosha on 6 Apr 2020
I solved it by rounding matrix I1 and I2

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!