Vertical concatenation of 8 table with identical rownames
조회 수: 3 (최근 30일)
이전 댓글 표시
So I am having a hard time to figure out this problem.
I have 8 tables, which each have a size of 65x3. The 65 rows have the same names in the same order on all 8 tables. When I try to combine them with vertical concatenation an error occurs, stating that I cannot concatenate tables with identical rownames. How can i solve this Problem? I haven't found a convienient way to automaticaly change the tables rownames to unique values.
Is there a function that automatically renames identical rownames?
I hope someone can help me. If you need any more information just tell me.
Thank you :)
댓글 수: 0
채택된 답변
Image Analyst
2022년 12월 4일
I don't think you can just vertically stitch them together because you are using row names. What are the row names? Do you really need them? If not get rid of them.
Otherwise to combine you can't just stitch them together. I think you'd have to combine as a function of row name so that each row name in the combined table would be a vector of 8 values.
If the values are just numbers and you want to ignore the row names, you can convert to a matrix and just stitch them together
m1 = table2array(t1);
m2 = table2array(t2);
m3 = table2array(t3);
m4 = table2array(t4);
m5 = table2array(t5);
m6 = table2array(t6);
m7 = table2array(t7);
m8 = table2array(t8);
combinedt = [m1; m2; m3; m4; m5; m6; m7; m8]
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!