How can i find a certain vector in a matrix?

57 vues (au cours des 30 derniers jours)
Lukas Nuschele
Lukas Nuschele le 2 Déc 2019
Commenté : Lukas Nuschele le 3 Déc 2019
Hey there,
I have a 3x370 Matrix and I want to find a 3x1 vector within the matrix.
Output should be the Column number of the 3x1 vector in the matrix.
I´be really glad if someone can help me :)
Greets Lukas

Réponse acceptée

David Hill
David Hill le 2 Déc 2019
Transpose and use ismember(A,B,'rows')
A=A';370x3
B=B';1x3
x=find(ismember(A,B,'rows'));%will give you the column numbers of A that match B
  1 commentaire
Lukas Nuschele
Lukas Nuschele le 3 Déc 2019
Thank you very much ,this works perfect :)

Connectez-vous pour commenter.

Plus de réponses (1)

Matt J
Matt J le 2 Déc 2019
[~,loc]=ismember(vector.',Matrix.','rows');

Catégories

En savoir plus sur Structures 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