Learn R Programming

pracma (version 1.1.0)

find: Find function (Matlab Style)

Description

Finds indices of nonzero elements.

Usage

find(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
find(-3:3 >= 0)
find(c(0, 1, 0, 2, 3))

Run the code above in your browser using DataLab