find {matlab2r}R Documentation

Find indices and values of nonzero elements

Description

Emulates behavior of find

Usage

find(x, sort = TRUE)

Arguments

x

object or logic operation on an object

sort

sort output?

Value

A vector of indices of x that satisfy the logical test (nonzero, by default).

Examples

X <- matrix(c(1, 0, 2, 0, 1, 1, 0, 0, 4), 3, byrow = TRUE)
Y <- seq(1, 19, 2)
find(X)
find(Y == 13)

[Package matlab2r version 1.5.0 Index]