How can I count the number of elements of a given value in a matrix?
Posted
by niko
on Stack Overflow
See other posts from Stack Overflow
or by niko
Published on 2010-05-21T09:29:49Z
Indexed on
2010/05/21
13:40 UTC
Read the original article
Hit count: 177
Does anyone know how to count the number of times a value appears in a matrix?
For example, if I have a 1500 x 1 matrix M
(vector) which stores the values of weekdays (1 - 7), how could I count how many Sundays (1), Mondays(2), ... , Saturdays(7) are stored in M
?
© Stack Overflow or respective owner