MATLAB: How to count

count

Hello all, I have a stochastic signal, and I want to count how many of the samples are positive,and how many are negative. Any suggestions?

Best Answer

To find how many equal -1
answer = length(find ( x1 == -1 ));
Related Question