kushaldsouza
kushaldsouza

Reputation: 708

Get path to folder using uigetfile in Matlab

I know that you can create a file browser in Matlab using uigetfile. However, I want the user to be able to select a destination folder. I am currently using the following code:

[filename, pathname] = uigetfile;

Using this, the user has to select a file within the destination folder in order to actually be able to close the file browser. Is there a better way of doing this ? For example, allow the user to select a folder and this closes the file browser whilst returning just the path to the chosen folder. Your help is much appreciated.

Upvotes: 4

Views: 11548

Answers (1)

b3.
b3.

Reputation: 7165

UIGETDIR is what you're looking for.

Upvotes: 5

Related Questions