Equivalent of "Enter"

38 ビュー (過去 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 Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by