find_first

Find the first true element index from a boolean vector.

Namespace: dsp

Prototype

int find_first(const Vecb &x)

Description

Example

let x = linspace(-2, 2, 5); // -2, -1, 0, 1, 2
let idx = find_first(x >= 0); // idx = 2

See also

find(), find_last()