input prompt

8 次查看(过去 30 天)
Talaria
Talaria 2011-8-21
how to make input function that displays text according to loop:
i.e. for i=1:30
g=input('enter "/i/"th line');
end
and it would display:
enter 1th line
enter 2th line
enter 3th line etc.....

采纳的回答

Chaowei Chen
Chaowei Chen 2011-8-21
for i=1:30
g=input(['enter ' int2str(i) ' th line']);
end
  1 个评论
John D'Errico
John D'Errico 2019-7-6
+1. But to be picky ... you needed to write it to know that it should be '1st', '2nd', '3rd', etc. ;-)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by