Simple for loop index
Afficher commentaires plus anciens
Hi,
Here is a simple piece of code to find the location of elements n within the vector A
A=[2,4,6,7,9];
for n=[4,9];
x=find(n==A);
end
However x only gives me the last location, i.e. 5, whereas I want the whole list of locations, i.e. [2,9] Thanks
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!