Can compare between vector and array

2 Ansichten (letzte 30 Tage)
huda nawaf
huda nawaf am 17 Aug. 2022
Kommentiert: huda nawaf am 17 Aug. 2022
Hello,
Can matching between vector and array where I have vector and large size of array, for example:
x with length 5 :x=[1 2 3 4 5];
A with size 3*5 A=[2 3 4 6 7; 10 11 1 2 3; 1 2 3 4 5];
Thanks
  1 Kommentar
James Tursa
James Tursa am 17 Aug. 2022
What do you want for output? A list of row numbers in A that match x? Or ...?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

James Tursa
James Tursa am 17 Aug. 2022
Bearbeitet: James Tursa am 17 Aug. 2022
Does this do what you want? Finds the row numbers in A that match x.
find(all(A==x,2))

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by