MATLAB: How to turn existing code into app and which components to use

app designerMATLAB

Hello! I would like to create an app that would promt a user to select a file from thier computer and then run code that I have already created. I know I need to use app designer but I do not understand which component to select to prompt the user to select and file and then on the back end how to apply my function. Any help is appreciated!

Best Answer

You can use any action UI control button in app designer, suppose mostly used one is push button. In the respective UI control call back write your code as
[flname, pt] = uigetfile('*.m', 'Select the m file');
run([pt, flname])
For more info/ help on MATLAB app designer read