Filter löschen
Filter löschen

How to find a vector in a matrix?

1 Ansicht (letzte 30 Tage)
M G
M G am 4 Sep. 2013
Kommentiert: nalja mot am 25 Dez. 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 :)

Akzeptierte Antwort

Matt J
Matt J am 4 Sep. 2013
[~,y]=ismember(v,x)

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by