How to vary the number of fields in inputdlg dynamically?

조회 수: 2 (최근 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)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by