how to find matching elements of two colums vectors
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
if i have a two column vectors generated from a figure like from apple. how can i combine them the matching elements using matlab. plz guide me
0 commentaires
Réponses (1)
M
le 12 Juin 2019
Modifié(e) : M
le 12 Juin 2019
It depends what you want exactly.
Let's say you have two vectors a and b:
a=[1;2;3;4];
b=[0;2;3;5];
To find the indices where a equals to b, you can simply compute:
a == b
ans =
4×1 logical array
0
1
1
0
To get the values and the indices where a equals to b, you can also have a look at the find function.
Voir également
Catégories
En savoir plus sur Matrix Indexing 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!