Borrar filtros
Borrar filtros

Finding the first 1 in indicator variable

2 visualizaciones (últimos 30 días)
Mads
Mads el 25 de Mayo de 2011
Hi all.
If i have an indicator variable which a bunch of 1's. How do i most efficiently find the position of the first 1?
Thx

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 25 de Mayo de 2011
out = find(A,1,'first')
A - your indicator variable (vector)
[outI,outJ] = find(A,1,'first')
here A - your indicator variable (matrix)

Más respuestas (0)

Categorías

Más información sobre MATLAB 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