Efficient way to count the number of times a value changes to a particular value in an array
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Afzal Ali
am 3 Dez. 2017
Beantwortet: the cyclist
am 3 Dez. 2017
What is the best way to do the following:
count=0;
for i=2:length(x)
if x(i)==1 && x(i-1)~=1
count=count+1;
end
end
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays 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!