How can I programmatically set uigetfiles() display mode and file sort order?

I use Matlab 2023b to create applications in Linux and Windows. The function uigetfiles() default behavior in Windows is to display files w/details, in reverse chronological order, which is what I want. Conversely, in Linux, it displays the same files as a list in chronological order. Users can use the UI tools to change default characteristics, but I'd like to set them programatically before the UI is displayed. Is there a way to control the display mode (icon, list, detail) and file order (alphabetical, chronological, etc?), or is there an alternative function that does this?

 Accepted Answer

uigetfiles() invokes system-specific behaviour that there no interface for. For example on Mac it invokes the MacOS file browser window.
You can build your own uigetfiles out of list boxes that you populate with whatever you want, and to which you add extra list entries for possibilities such as changing the sort order or selecting a different directory.

3 Comments

Thanks Walter.
Of the options proposed, fileexchange/10867 is a better starting point for my needs, but both options lack the file-tree navigation tool which makes them less desirable than uigetfile(). I'd prefer to use an existing utility than adapting either of these to my needs.
I just went through and tagged a number of contributions that impliment file choosers (to varying degree of utility)

Sign in to comment.

More Answers (0)

Categories

Find more on App Building in Help Center and File Exchange

Products

Release

R2023b

Asked:

on 7 Jan 2025

Commented:

on 10 Jan 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!