Equivalent of "Enter"

38 vues (au cours des 30 derniers jours)
David Zhang
David Zhang le 21 Oct 2016
Commenté : David Zhang le 22 Oct 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!

Réponse acceptée

KSSV
KSSV le 21 Oct 2016
Modifié(e) : KSSV le 21 Oct 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:')
  1 commentaire
David Zhang
David Zhang le 22 Oct 2016
Thanks!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by