Can compare between vector and array

2 vues (au cours des 30 derniers jours)
huda nawaf
huda nawaf le 17 Août 2022
Commenté : huda nawaf le 17 Août 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 commentaire
James Tursa
James Tursa le 17 Août 2022
What do you want for output? A list of row numbers in A that match x? Or ...?

Connectez-vous pour commenter.

Réponse acceptée

James Tursa
James Tursa le 17 Août 2022
Modifié(e) : James Tursa le 17 Août 2022
Does this do what you want? Finds the row numbers in A that match x.
find(all(A==x,2))

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by