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 CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by