Test whether all or any elements of two vectors or matricies are equal
How can I create logic to test whether all or any entries in two vectors or matricies are equal?
If A and B are vectors, the expression A=B is a conditional vector whose elements are true when corresponding A and B elements are equal. If you want to test whether all elements of A are equal to corresponding B elements, you could use the formula prodv(A=B). If you wanted to test whether any elements of A are equal to B, you could use the formula sumv(A=B). Both of these formulas give simple scalar true/false results. The same can be done for other comparison operators: sumv(A<B), sumv(A<=B), etc.
See Also More modeling tips and tricks