Effacer les filtres
Effacer les filtres

How to find a vector in a matrix?

1 vue (au cours des 30 derniers jours)
M G
M G le 4 Sep 2013
Commenté : nalja mot le 25 Déc 2018
Hi all,
Assume a vector:
v = [1:3:1000];
How can I find the number of columns of each value in the vector:
x = [100, 280, 781, 925, 997];
in the bigger vector, v.
I tried:
y = find(x == v)
But no success! Any hint is greatly appreciated :)

Réponse acceptée

Matt J
Matt J le 4 Sep 2013
[~,y]=ismember(v,x)
  1 commentaire
nalja mot
nalja mot le 25 Déc 2018
thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by