function similar to count
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
SSG_newbiecoder
am 26 Dez. 2017
Kommentiert: SSG_newbiecoder
am 26 Dez. 2017
Is there any function similar to count that can be used in an array of 1's,-1's and 0's to count the number of 1's present in a particular range?
Akzeptierte Antwort
Birdman
am 26 Dez. 2017
One approach:
A=randi([-1 1],1,100);%random data for -1,0 and 1
cnt=sum(ismember(A,1));%counts the number of 1 in array A
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!