필터 지우기
필터 지우기

Join two tables with different sizes

조회 수: 9 (최근 30일)
Robert
Robert 2018년 6월 2일
댓글: Walter Roberson 2018년 6월 2일
Hello,
I am trying to join two tables with different sizes
A = 50000 x 12
B = 9 x 3
Both matrices have a variable name 'UnqID'
Basically, I am trying to add information from table B column 2 and 3, following the same UnqID, in table A.
This is just an example of what I need to do, as the real tables have a larger size (different size)
I am following the examples at
https://www.mathworks.com/help/matlab/ref/table.join.html
and
https://www.mathworks.com/help/matlab/ref/outerjoin.html
...however, I am getting this error...
Error using tabular/outerjoin (line 141)
Left and right key variables 'UnqID' and 'UnqID' do not have the same number of columns.
In mathwork examples, the tables can have different size, so not sure what is happening.
Any suggestions? Thanks!
  댓글 수: 4
Robert
Robert 2018년 6월 2일
Walter, for some reason I don't see where to accept your answer on this page...
Walter Roberson
Walter Roberson 2018년 6월 2일
I had only entered it as a Comment; I've made it an Answer now.

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

채택된 답변

Walter Roberson
Walter Roberson 2018년 6월 2일
The error message suggests that size(A.UnqID,2) is not the same as size(B.unqID,2)

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by