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 日

1 投票

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 件)

カテゴリ

ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by