Language Reference

ANY Function

checks for any nonzero element

ANY( matrix)

where matrix is a numeric matrix or literal.

The ANY function returns a value of 1 if any of the elements in matrix are nonzero. If all the elements of matrix are zeros, the ANY function returns a value of 0. Missing values in matrix are treated as zeros.

For example, consider the statement

  
    if any(a=b) then print a b;
 
The matrices a and b are printed if at least one value in a is the same as the corresponding value in b. The following statements do not print the message:
  
    a={-99 99}; 
    b={-99 98}; 
    if a^=b then print 'a^=b';
 
However, the following statement prints the message:
  
    if any(a^=b) then print 'a^=b';
 

Previous Page | Next Page | Top of Page