필터 지우기
필터 지우기

Row position and find value

조회 수: 8 (최근 30일)
Alexandra Philip
Alexandra Philip 2020년 6월 30일
댓글: madhan ravi 2020년 6월 30일
I have having some trouble with locating the position of the row in a table and then using that same row to find the value in column 3.
I first used:
Accelval=find(strcmp(mergetable1{:,1},AccelSN),1) to find the value where the first column matches the variable where the user has an input. The I would like to find the row position of this value. After determining the row position, I must create a new variable that uses the row position to find the value in column 3.
Any suggestions?

채택된 답변

madhan ravi
madhan ravi 2020년 6월 30일
Replace
Accelval
with
[rows, columns] = ... and use the rows to index the table of column 3
  댓글 수: 2
Alexandra Philip
Alexandra Philip 2020년 6월 30일
Thank you. So, just for clarification, I would use:
[rows, columns]=find(strcmp(mergetable1{:,1},AccelSN),1)
BIA1=mergetable1{rows,3}
madhan ravi
madhan ravi 2020년 6월 30일
Yes

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by