You can use the "Variable" section to fill the list dynamically. The only catch is, you need to define the variable in the workspace first. For example, just define a one element array in the base workspace "dropdownlist". Then right click on the dropdown and select "Configure Control". Once you do that, select the "Variable" option and set it to "dropdownlist".
Now you just need to update "dropdownlist" in your code before the dropdown and it will show the list correctly. Please refer to the images below:
Before running the code: dropdownlist = [""];
After running the code:
This should work in your case.
Alternative:
If this doesn't work, you can create a uifigure and add a uidropdown to it. See the code below:
fileNames = {'data1.csv', 'data2.csv', 'experiment1.txt', 'results.xlsx', 'summary.docx'};
fig = uifigure('Name', 'Dynamic Dropdown Example');
dropdown = uidropdown(fig, ...
'Position', [100, 100, 200, 22]);