ANY (matrix);
The ANY function returns a value of 1 if any of the elements in matrix are nonzero. If all the elements of matrix are zero or missing, the ANY function returns a value of 0.
You can use the ANY function to compare elements in two matrices, as shown in the following statements:
a = {1 2, 3 4}; b = {3 2, 1 0}; if any(a=b) then msg = "for some element, a[i,j] equals b[i,j]"; else msg = "a ^= b"; print msg;
In the preceding statements, the IF-THEN expression is true if at least one element in a
is the same as the corresponding element in b
. You can use the ALL
function to compare all of the elements in two matrices.