Hi, I have A (100 x 2 double), and B (90 x 2) variable. I want to combine these two by common values in the first column of A, and B, so that I have C, a 90(?) x 3 double, where the first column is the common values of the first columns of A and B, the second column is the values of the second column of A, and the third column is the values of the second values of B. I have tried the union function, but have not managed to get this to work...Any help would be appreciated! Thanks! Sushma

 채택된 답변

Walter Roberson
Walter Roberson 2016년 11월 4일

0 개 추천

One way is innerjoin()
Another way is:
[tf, idx] = ismember(A(:,1), B(:,1));
[A(tf,:), B(idx(tf),2)]

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

질문:

2016년 11월 4일

답변:

2016년 11월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by