採用された回答

Birdman
Birdman 2020 年 3 月 30 日

2 投票

newline
For instance:
chr = 'Whose woods these are I think I know.';
chr = [chr newline 'His house is in the village though']
chr =
['Whose woods these are I think I know...'
'His house is in the village though']

2 件のコメント

John D'Errico
John D'Errico 2020 年 3 月 30 日
編集済み: John D'Errico 2020 年 3 月 30 日
To add...
>> newline
ans =
'
'
Note the vertically displaced quotes as displayed in the command window.
Umut Oskay
Umut Oskay 2020 年 3 月 30 日
thanks

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2020 年 3 月 30 日

13 投票

When used in a format specifier string, it puts the following stuff on a new line:
>> fprintf('Line 1\nLine 2\nLine 3\n\nLine 4\n')
Line 1
Line 2
Line 3
Line 4

1 件のコメント

Umut Oskay
Umut Oskay 2020 年 3 月 30 日
it is the best answer i think thank you

サインインしてコメントする。

カテゴリ

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

タグ

質問済み:

2020 年 3 月 30 日

コメント済み:

2020 年 3 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by