Finding elements according to indices from an array
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Md. Asadujjaman
le 17 Jan 2022
Réponse apportée : Image Analyst
le 17 Jan 2022
Suppose,
x=[11 13 10 16 15 19 12 18 17 14]
y=[1 2 5 7 10]
I want to find the elements according to the indices presented in y.
The answer would be
[11 13 15 12 14]
0 commentaires
Réponse acceptée
Image Analyst
le 17 Jan 2022
x=[11 13 10 16 15 19 12 18 17 14];
y=[1 2 5 7 10];
theAnswer = x(y)
Try looking at this:
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Workspace Variables and MAT-Files dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!