How to find a vector in a matrix?

4 visualizzazioni (ultimi 30 giorni)
M G
M G il 4 Set 2013
Commentato: nalja mot il 25 Dic 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 :)

Risposta accettata

Matt J
Matt J il 4 Set 2013
[~,y]=ismember(v,x)

Più risposte (0)

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by