MATLAB: Many inputs according to user’s wish

MATLABmatlab guivariable number of inputs

I need to let the user enter a certain number of inputs according to the number he has specified before in GUI,
I have done this in the coding
for i = 1:nbofact
actname = 'What is the activity?'
activities(i).name = input(actname)
actdur = 'What is the activity duration?'
activities(i).duration = input(actdur)
end
I want to do the same in GUI but don't know to keep erasing the input the user enters and storing it until it reaches a certain limit.

Best Answer

Since you say you're doing this in the context of a GUI, use inputdlg instead of calling input repeatedly.