필터 지우기
필터 지우기

comparing the two column in MATLAB

조회 수: 42 (최근 30일)
Sky Scrapper
Sky Scrapper 2018년 11월 22일
댓글: Celestie Gladys 2023년 1월 26일
Hello!
Let, A=[ 1 2 ; 2 2; 3 4; 4 4]
I want to compare the 1st column with the 2nd column to find out if there is any row having the same values in both columns.
Say, in the example, 2nd and 4th rows have the same values in both the two columns. i need to find the rows where the condition is satisfied.
Could you please help me?

채택된 답변

madhan ravi
madhan ravi 2018년 11월 22일
편집: madhan ravi 2018년 11월 22일
rowswithidenticalvalues=find(A(:,1)==A(:,2)) %1 indicates the values are the same
  댓글 수: 5
madhan ravi
madhan ravi 2018년 11월 22일
Anytime :)
Celestie Gladys
Celestie Gladys 2023년 1월 26일
@madhan ravi if i have to find the same colums in not just for 1st and 2nd colum but for the entire matrix ?

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by