Vectorized FIND

version (1.38 KB) by Steven Lord
This function returns the locations of the elements of a vector in a matrix.


Updated Tue, 12 Mar 2002 11:01:15 +0000

View License

If A is a matrix and b is a column vector, this function returns a column vector of indices I such that A(I)==b if the elements of b are in A. If an element of b is not in A, then the corresponding element of I is Inf.

As an example, you can execute the following code:


The example above uses I(1:3) because I(4) is Inf; the matrix A does not have 6 as an entry.

Cite As

Steven Lord (2022). Vectorized FIND (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!