Extract values common to 5 columns
이전 댓글 표시
Hi, I have a matrix A with 5 columns (1 to 5). I want to compare columns 1 through 5 and then extract values common to all 5 columns. Put the extracted values (common to all 5 columns) into a separate matrix called Match. Thank you!
댓글 수: 4
James Tursa
2020년 1월 24일
What have you done so far? What specific problems are you having with your code?
Curious Mind
2020년 1월 24일
편집: Curious Mind
2020년 1월 24일
Star Strider
2020년 1월 24일
Is this homework? If so we can only give hints.
If it is not homework, I will post my general solution.
Curious Mind
2020년 1월 24일
채택된 답변
추가 답변 (1개)
James Tursa
2020년 1월 24일
0 개 추천
Hint: Look at the result of diff(A,[],2). If all the values in a row are equal, what would you expect to be in the result of this diff calculation? Can you devise a test base on this result to see if every value in a row is the same?
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!