find row index if all column elements are known

조회 수: 1 (최근 30일)
amit jha
amit jha 2019년 8월 18일
편집: Bruno Luong 2019년 8월 18일
I have a nx3 matrix. I need to find row index if i know all the column entries of a particular row. How to do it in a simple command.
Thanks,
Amit.

답변 (1개)

Bruno Luong
Bruno Luong 2019년 8월 18일
편집: Bruno Luong 2019년 8월 18일
If A is your array, for example
A=ceil(10*rand(10000,3))
and you want to find [1,2,3] this command
find(ismember(A,[1 2 3],'rows'))
will return the row index(es) of matched data.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by