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!