Find indices and values of nonzero elements

returns
a vector containing the linear
indices of each nonzero element in array `k`

= find(`X`

)`X`

.

If

`X`

is a vector, then`find`

returns a vector with the same orientation as`X`

.If

`X`

is a multidimensional array, then`find`

returns a column vector of the linear indices of the result.If

`X`

contains no nonzero elements or is empty, then`find`

returns an empty array.

Was this topic helpful?