How to concatenate two columns in one table into one column?
Mostrar comentarios más antiguos
Hi,
I have a table of 5 columns with strings, I would like to concatenate the two columns by a "_" and make them into one column.
Table A:
var1 var2 var3 var4 var5 ABC 123 aaa bbb ccc EFG 345 ddd eee fff into B: var1 ABC_123 EFG_345
How to do that?
Thanks.
Jennifer
1 comentario
JFz
el 26 de Ag. de 2015
Respuesta aceptada
Más respuestas (1)
Varun Bhaskar
el 28 de Ag. de 2015
0 votos
Hi,
It is not possible to concatenate two columns after the table has been constructed. You can concatenate the two columns prior to constructing the table using the 'strcat' function.
1 comentario
Peter Jarosi
el 12 de Jul. de 2019
Eh,
It's not true. I tried JFz's idea for tables already been constructed. It works! At least in Matlab 2016a or later versions.
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!