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

16 vues (au cours des 30 derniers jours)
RR RR
RR RR le 9 Nov 2019
Commenté : RR RR le 9 Nov 2019
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

Réponse acceptée

Walter Roberson
Walter Roberson le 9 Nov 2019
strjoin(A,'\n')

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by