Vertical concatenation of 8 table with identical rownames
6 ビュー (過去 30 日間)
古いコメントを表示
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 :)
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!