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

조회 수: 6 (최근 30일)
RR RR
RR RR 2019년 11월 9일
댓글: RR RR 2019년 11월 9일
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일
strjoin(A,'\n')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by