Effacer les filtres
Effacer les filtres

how to find matching elements of two colums vectors

13 vues (au cours des 30 derniers jours)
M.S. Khan
M.S. Khan le 12 Juin 2019
Commenté : M.S. Khan le 12 Juin 2019
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

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:
To find the indices where a equals to b, you can simply compute:
a == b
ans =
4×1 logical array
To get the values and the indices where a equals to b, you can also have a look at the find function.
  1 commentaire
M.S. Khan
M.S. Khan le 12 Juin 2019
Thanks for community support. let me phrase my questions with more detail
lets suppose i have vertices of a tea cup.
Vx =[ 0;1;2;0;9]
Vy = [1;1;,2;;3]
Vz= = [38,32,-1]
They are cancatenated in a larger matrix = [Vx Vy Vz].
After sorting, i want to find first elements or coordinates like (0,1,38) here in Vx,Vy,Vz wherever they meet or match, it should be labelled as 5 in that particular grid.
Your guidance will be highly appreciated.

Connectez-vous pour commenter.


En savoir plus sur Migrate GUIDE Apps 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!

Translated by