Learn R Programming

pracma (version 1.9.3)

finds: find function (Matlab Style)

Description

Finds indices of nonzero elements.

Usage

finds(v)

Arguments

v
logical or numeric vector or array

Value

Indices of elements matching the expression x.

Details

Finds indices of true or nonzero elements of argument v; can be used with a logical expression.

Examples

Run this code
finds(-3:3 >= 0)
finds(c(0, 1, 0, 2, 3))

Run the code above in your browser using DataLab