Reputation: 523
I have two integer arrays that I need to compare. The output of the comparison of sequenceOne = [1, 3, 2, 1]
and sequenceTwo = [1, 3, 2, 1]
should be true. Is there a method for that?
Upvotes: 2
Views: 8336
Reputation: 10984
Just use ==
:
julia> sequenceOne = [1, 3, 2, 1];
julia> sequenceTwo = [1, 3, 2, 1];
julia> sequenceOne == sequenceTwo
true
Alternatively, if you are looking to compare elementwise then you can broadcast ==
with a .
julia> sequenceOne .== sequenceTwo
4-element BitArray{1}:
true
true
true
true
Upvotes: 5