uigetfile function opens a diaglog by default checking to all MATLAB files.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/547068/image.png)
You can change the option to "All Files" in order to display the text files in dialog box.
As an example
filename = uigetfile("*.txt"); % opens a dialog box with all filenames ending with .txt