MATLAB: Hi every one ,

MATLABmatrix

A=[ 1 1 1 2 2 3 3 3 1 1 4 4 4 2 2 3 3 3 4 3 ]
how can i count the number of 1 and 2 and 3 and 4 in the row vector
thank u

Best Answer

sum(A==1) % or sum(A==2)...