the function of \n

482 次查看(过去 30 天)
Umut Oskay
Umut Oskay 2020-3-30
评论: Umut Oskay 2020-3-30
what is the function of \n ?

采纳的回答

Birdman
Birdman 2020-3-30
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.

请先登录,再进行评论。

更多回答(1 个)

Image Analyst
Image Analyst 2020-3-30
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

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by