Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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?