input prompt

조회 수: 9 (최근 30일)
Talaria
Talaria 2011년 8월 21일
댓글: John D'Errico 2019년 7월 6일
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