How to 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?
채택된 답변
추가 답변 (1개)
Titus Edelhofer
2011년 4월 5일
Hi Negar,
just count them
nPos = sum(x1==1)
nNeg = sum(x1==-1)
Titus
댓글 수: 1
Jan
2011년 4월 5일
SUM is usually faster than LENGTH(FIND).
nNeg = numel(x1) - nPos
카테고리
도움말 센터 및 File Exchange에서 Signal Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!