Vectorized FIND
Version 1.0.0.0 (1,38 ko) par
Steven Lord
This function returns the locations of the elements of a vector in a matrix.
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:
rand('state',0)
A=floor(20*rand(5))
b=[18;8;9;6]
I=findin(A,b)
A(I(1:3))
The example above uses I(1:3) because I(4) is Inf; the matrix A does not have 6 as an entry.
Citation pour cette source
Steven Lord (2026). Vectorized FIND (https://fr.mathworks.com/matlabcentral/fileexchange/1472-vectorized-find), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Créé avec
R12
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS LinuxCatégories
En savoir plus sur Operating on Diagonal Matrices dans Help Center et MATLAB Answers
Tags
Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.0.0.0 |
