My first user-input prompt is to enter a number (say, x). What should I write if my next message box MUST contain the same number of prompt questions as x?
3 ビュー (過去 30 日間)
古いコメントを表示
Hi! My first user-input prompt is to enter a number (say, x). What should I write (code) if my next message box MUST contain the same number of prompt questions as x?
0 件のコメント
採用された回答
Steven Lord
2022 年 8 月 22 日
I'd use a string array. I'm going to hard code the value of n to keep this example simple, but you could query for it using a dialog.
n = 5;
questions = "Enter the value for element number " + (1:n);
inputdlg(questions)
その他の回答 (0 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!