Merging tables with partly the same column names, but sometimes different dimensions
조회 수: 26 (최근 30일)
이전 댓글 표시
Hi,
I have two tables with partly the same variable names. I want to merge these together and put them underneath each other, with all values of each variable under each other and empty cases for variables that are not present in the one table.
How can I do this?
Thank you!
댓글 수: 0
채택된 답변
Bora Eryilmaz
2022년 12월 21일
편집: Bora Eryilmaz
2022년 12월 21일
This seems like a table (outer) join problem. Take a look at: https://www.mathworks.com/help/matlab/ref/table.outerjoin.html
Tleft = table({'a' 'b' 'c'}', [1 2 3]', 'VariableNames', {'Key1' 'Var1'})
Tright = table({'a','b','d'}', [4 5 6]', 'VariableNames', {'Key1' 'Var2'})
T = outerjoin(Tleft, Tright, 'MergeKeys', true)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!