How to find specific entry values in a vector?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I would like to consider only the 3's between the 1's and 2's.
x = [1, 1, 1, 3, 3 ,3 ,2 ,2, 3, 3, 1, 1, 1 , 3, 3, 2 ,3,...];
Desired result: r = [0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0 ,3 ,3 , 0 ,....]
for i = 1:length(x)-1
if x(i)==1 && x(i+1) == 3
while ...?
0 comentarios
Respuestas (1)
Ver también
Categorías
Más información sobre Loops and Conditional Statements 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!