Vertical concatenation of 8 table with identical rownames

6 visualizaciones (últimos 30 días)
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 :)

Respuesta aceptada

Image Analyst
Image Analyst el 4 de Dic. de 2022
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 comentario
Marcel-Maximilian
Marcel-Maximilian el 4 de Dic. de 2022
Hey thanks for your answer i did not think of that. That should solve my problem.
Thank you very much. :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by