1
$\begingroup$

I am wondering how to compare 3 variables in MATLAB, because MATLAB is comparing first 2 and then result against 3rd. To illustrate with example:

(-1 == -1 == -1)

ans =

0 

(-1 == -1 == 1)

ans =

1 

My dataset that I am comparing has only -1 and +1 values. Is the only solution is to convert everything to 1's and 0's?

1 Answers 1

0

How about:

(a == b) && (b == c) 
  • 0
    Came here to reply to my ow$n$ question and found out that it is answered! Thanks!2012-11-04