How to find the row and column number in a table
조회 수: 4 (최근 30일)
이전 댓글 표시
I want to find the row and column number in a table for expemple A=[1 13 4 7 5 10 21] What is the row and column of 7
댓글 수: 0
답변 (1개)
Abhishek Tiwari
2022년 6월 30일
Hi,
It can be done with a simple conditional expression and find(). The conditional statement will convert your vector to a binary vector, and then find() will locate all the values that are 1. Here's an example:
A = [1 13 4 7 5 10 21];
[row, column] = find(A==7)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!