Equivalent of "Enter"

41 Ansichten (letzte 30 Tage)
David Zhang
David Zhang am 21 Okt. 2016
Kommentiert: David Zhang am 22 Okt. 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!

Akzeptierte Antwort

KSSV
KSSV am 21 Okt. 2016
Bearbeitet: KSSV am 21 Okt. 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:')

Weitere Antworten (0)

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by