MATLAB: How to run a file automatically based on user file input

dialog-boxinput

Hi, I have created dialog boxes that guide the user through a few steps and finally asks the user to select a file that they want to be processed based on their inputs. The issue I am having is that I would like whatever file the user chooses is automatically added to an existing script (this script reads in a file, extracts relevant information and puts it into an array). At the moment I have to manually type in the name of the file to run it. I have looked around and can’t seem to find anything remotely related to what I need. Any help would be highly appreciated. Thankyou