필터 지우기
필터 지우기

Vertical concatenation of 8 table with identical rownames

조회 수: 3 (최근 30일)
Marcel-Maximilian
Marcel-Maximilian 2022년 12월 4일
댓글: Marcel-Maximilian 2022년 12월 4일
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 :)

채택된 답변

Image Analyst
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:
  댓글 수: 1
Marcel-Maximilian
Marcel-Maximilian 2022년 12월 4일
Hey thanks for your answer i did not think of that. That should solve my problem.
Thank you very much. :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by