Refer to the attached example App Designer file named 'ExampleDirectoryApp.mlapp'. In the attached example App, there is a 'browse' button, a label to display the selected folder location, and a uitable to display the contents of the selected folder location. When the app is run, the user clicks on the 'browse' button to trigger a callback. The callback executes the 'uigetdir' command to get the directory and then displays the directory to the label. Finally, the callback obtains the directory contents using the 'dir' command and displays the contents in the uitable.
For more information and details about the implementation, refer to the attached file and the comments in the file. Please note that, because the contents of the directory are displayed in a uitable, the contents are selectable. That is, if desired, the 'CellSelectionCallback' can be created on the uitable to execute code based on the user's selection of the folder's contents. Please also note that the app was designed to be run in MATLAB R2018a.
For more information about the relevant functions and callbacks in this example app, please refer to the following links:
: If you are having trouble downloading the attachment, please right-click on the file and select 'Save link as...'.