keep the same row data from two matrix
조회 수: 2 (최근 30일)
이전 댓글 표시
i have a total data matrix a(253*2), now i just want to keep the data from b(223*1) and get the whole data is c(223*2), which means that keep the same data between a&b. how should i do?
댓글 수: 3
Mathieu NOE
2021년 3월 25일
OK so you have to use find the get the similar values from col 1 in a and b
ind = find(a(:,1) == b);
c = a(ind,:);
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!