Respuesta aceptada

Birdman
Birdman el 30 de Mzo. de 2020

2 votos

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 comentarios

John D'Errico
John D'Errico el 30 de Mzo. de 2020
Editada: John D'Errico el 30 de Mzo. de 2020
To add...
>> newline
ans =
'
'
Note the vertically displaced quotes as displayed in the command window.
Umut Oskay
Umut Oskay el 30 de Mzo. de 2020
thanks

Iniciar sesión para comentar.

Más respuestas (1)

Image Analyst
Image Analyst el 30 de Mzo. de 2020

13 votos

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 comentario

Umut Oskay
Umut Oskay el 30 de Mzo. de 2020
it is the best answer i think thank you

Iniciar sesión para comentar.

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 30 de Mzo. de 2020

Comentada:

el 30 de Mzo. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by