Borrar filtros
Borrar filtros

Finding the greatest value

2 visualizaciones (últimos 30 días)
shanmukh
shanmukh el 15 de Mayo de 2013
i have a column D where i have to find the places greater than 10.
1
2
3
4
10
11
4
5
6
10
11
3
i am getting an answer 5,6,10,11.
if there are 2 values one after the other which satisfy >10, i need to skip the 5,10 and display only 6,11.
my final answer should only be 6,11
please help me out

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 15 de Mayo de 2013
Editada: Azzi Abdelmalek el 15 de Mayo de 2013
x=[1 2 3 4 10 11 4 5 6 10 11 1 2 ]
id=find(x>=10)
a=[diff(id) 20]
idx=id(find(a~=1))

Más respuestas (1)

Jan
Jan el 15 de Mayo de 2013
x = [1, 2, 3, 4, 10, 11, 4, 5, 6, 10, 11, 3];
m = x > 10;
m(strfind(m, [false, true])) = false;
index = find(m);

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by