Equivalent of "Enter"

37 次查看(过去 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:')

更多回答(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