How to concatenate two columns in one table into one column?
古いコメントを表示
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 件)
Varun Bhaskar
2015 年 8 月 28 日
0 投票
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 件のコメント
Peter Jarosi
2019 年 7 月 12 日
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.
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!