Equivalent of "Enter"

조회 수: 39 (최근 30일)
David Zhang
David Zhang 2016년 10월 21일
댓글: David Zhang 2016년 10월 22일
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!

채택된 답변

KSSV
KSSV 2016년 10월 21일
편집: KSSV 2016년 10월 21일
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
David Zhang
David Zhang 2016년 10월 22일
Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by