Ältere Kommentare anzeigen
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 Kommentar
Negar
am 5 Apr. 2011
Akzeptierte Antwort
Weitere Antworten (1)
Titus Edelhofer
am 5 Apr. 2011
Hi Negar,
just count them
nPos = sum(x1==1)
nNeg = sum(x1==-1)
Titus
1 Kommentar
Jan
am 5 Apr. 2011
SUM is usually faster than LENGTH(FIND).
nNeg = numel(x1) - nPos
Kategorien
Mehr zu Signal Processing Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!