How can i find a certain vector in a matrix?

55 ビュー (過去 30 日間)
Lukas Nuschele
Lukas Nuschele 2019 年 12 月 2 日
コメント済み: Lukas Nuschele 2019 年 12 月 3 日
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

採用された回答

David Hill
David Hill 2019 年 12 月 2 日
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 件のコメント
Lukas Nuschele
Lukas Nuschele 2019 年 12 月 3 日
Thank you very much ,this works perfect :)

サインインしてコメントする。

その他の回答 (1 件)

Matt J
Matt J 2019 年 12 月 2 日
[~,loc]=ismember(vector.',Matrix.','rows');

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by