File Exchange

image thumbnail


version (8.62 KB) by Emmanuel Farhi
A fileselector as uigetfile, with multiple selection which does not require Java


Updated 29 Jan 2009

View License

Displays a dialog box for the user to fill in, and returns the filename and path strings. Multiple choices are possible, as well as directory names. Both returned values are then char or cellstr. This function behaves exactly as uigetfile, but in multiple and dirextory mode. The file selector also provides extended functionalities (file edit, sorting, tool tips, filters, wildcards, directory history, ...)

Use strcat(pathname, filesep, filename) to obtain full file name.

options may be: 'Location', [x y]
or [x y]
and 'MultiSelect', 'on'|'off'

Cite As

Emmanuel Farhi (2020). uigetfiles (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

Nice! Could you make it so that filtering works? I'd like to, for example, invoke like this: [a,b]=uigetfiles('A*.m','hi') and show only the m-files that begin with 'A'.

I just updated the uigetfiles to handle names with spaces. This also affects sorting. Bugs reported by Petr Krysl should be solved as soon as the update comes into line.

Petr Krysl

The double-clicking to open folders doesn't work for "Documents and settings" or for "My music": does it have something to do with multi-word with spaces names?

Petr Krysl

I'm sorry to report that sorting doesn't work. Nothing seems to happen after the folder has been sorted by name.

Dear Petr Krysl,

The double click does opens folders in principle. Single click selects folders, and clicking OK button then returns the selected folder(s). This has been tested on many platforms and Matlab release, but perhaps I missed the config you use.

Petr Krysl

This may be a good start. I've tried browsing through folders however, and instead of allowing me to go into folders the tool would just select the folder and return it. Perhaps this is a design feature? If it is, it shouldn't be. Double-clicking a folder should open it.


Fixed handling of names with spaces (e.g. Windows) and sorting.

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux