Can compare between vector and array

2 次查看(过去 30 天)
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