Efficient way to count the number of times a value changes to a particular value in an array
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Afzal Ali
el 3 de Dic. de 2017
Respondida: the cyclist
el 3 de Dic. de 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 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Multidimensional Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!