6.45.13 Counting the elements equal to a given value: count_eq
The count_eq command counts the number of elements in a
matrix equal to a given value.
-
count_eq takes two arguments:
-
a, a value.
- A, a matrix or a list.
- count_eq(a,A) returns the number of elements of
A that are equal to a.
Example.
Input:
count_eq(12,[[2,12,45],[3,7,78]])
Output: