Counts the number of true array elements in an entire logical array, or in each vector along a single dimension. Typically, the logical array is one that is used as a mask in another intrinsic.
If DIM is present, the result is an integer array of rank rank(MASK)-1. If DIM is missing, or if MASK has a rank of one, the result is a scalar of type integer.
Each element of the resulting array (R(s1, s2, ..., s(DIM-1), s(DIM+1), ..., sn)) equals the number of elements that are true in MASK along the corresponding dimension (s1, s2, ..., s(DIM-1), :, s(DIM+1), ..., sn).
If MASK is a zero-sized array, the result equals zero.
! A is the array | T F F |, and B is the array | F F T | ! | F T T | | T T T | ! How many corresponding elements in A and B ! are equivalent? RES = COUNT(A .EQV. B) ! result RES is 3 ! How many corresponding elements are equivalent ! in each column? RES = COUNT(A .EQV. B, DIM=1) ! result RES is (0,2,1) ! Same question, but for each row. RES = COUNT(A .EQV. B, DIM=2) ! result RES is (1,2)