How to vary the number of fields in inputdlg dynamically?

3 ビュー (過去 30 日間)
Sarath S
Sarath S 2020 年 6 月 6 日
コメント済み: Ameer Hamza 2020 年 6 月 6 日
Im trying to get values for n number of fields where n is specified by the user previously.
For example.
After this, depending upon the value user enters, lets say 5, I need another dialog box to gather 5 values.
The next dialog box should look soemthing like this:
Enter thickness of growth
Zone 1:
Zone 2:
Zone 3:
Zone 4:
Zone 5:

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 6 月 6 日
Something like this
n = inputdlg('Number of Zones');
n = str2double(n{1});
prompts = compose('Zone %d', 1:n);
y = inputdlg(prompts)
  2 件のコメント
Sarath S
Sarath S 2020 年 6 月 6 日
Thanks a lot!
Ameer Hamza
Ameer Hamza 2020 年 6 月 6 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by