Borrar filtros
Borrar filtros

Index cell where number jumps

9 visualizaciones (últimos 30 días)
Brent
Brent el 21 de Nov. de 2011
I'm trying to identify the cell where the numbers jumps drastically...
example:
[1 2 3 4 5 6 20 21 22 23 24 25 60 61 62 63 64 65]
How do I indentify the index where 6 and 25 stop in the section of increasing numbers and the new section of increasing numbers continues.
Thanks for your help!

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 21 de Nov. de 2011
A=[1 2 3 4 5 6 20 21 22 23 24 25 60 61 62 63 64 65]
B=diff(A)
find(B>1)

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by