Equivalent of "Enter"

39 visualizzazioni (ultimi 30 giorni)
David Zhang
David Zhang il 21 Ott 2016
Commentato: David Zhang il 22 Ott 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!

Risposta accettata

KSSV
KSSV il 21 Ott 2016
Modificato: KSSV il 21 Ott 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:')

Più risposte (0)

Categorie

Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by