Equivalent of "Enter"

39 visualizaciones (últimos 30 días)
David Zhang
David Zhang el 21 de Oct. de 2016
Comentada: David Zhang el 22 de Oct. de 2016
I'm writing a script, but when I use fprintf('The result is %d',y) and then the x=input('Enter x') in a new line on the script, when I run the script, both messages appear on one line. I was wondering if there is a way to make it so that each message appears on a new line, sort of like the equivalent of typing "Enter" when using Office word. Thanks!

Respuesta aceptada

KSSV
KSSV el 21 de Oct. de 2016
Editada: KSSV el 21 de Oct. de 2016
Add '\n' at the end of fprintf. This gives control to the next line.
fprintf('The result is %d\n',y) ;
x=input('Enter x:')

Más respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by