Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

How about:

(a == b) && (b == c)
share|improve this answer
    
Came here to reply to my own question and found out that it is answered! Thanks! –  jpou Nov 4 '12 at 12:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.