Can compare between vector and array

조회 수: 1 (최근 30일)
huda nawaf
huda nawaf 2022년 8월 17일
댓글: huda nawaf 2022년 8월 17일
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
James Tursa
James Tursa 2022년 8월 17일
What do you want for output? A list of row numbers in A that match x? Or ...?

댓글을 달려면 로그인하십시오.

채택된 답변

James Tursa
James Tursa 2022년 8월 17일
편집: James Tursa 2022년 8월 17일
Does this do what you want? Finds the row numbers in A that match x.
find(all(A==x,2))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by