String array to 1d string by adding the new line character

Hello All,
Say that you have nx1 string array A such as follows:
A=["Hello Matlab"; "this is 12345"; "so we are going to" ; "have fun"]
how can I combine them into a 1x1 string but by adding a new line chacter after each string i.e."
A=["Hello Matlab\nthis is 12345\nso we are going to\nhave fun"]
Thanks

 採用された回答

Walter Roberson
Walter Roberson 2019 年 11 月 9 日

0 投票

strjoin(A,'\n')

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

製品

タグ

質問済み:

2019 年 11 月 9 日

コメント済み:

2019 年 11 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by