How can I use uigetfile to get the file path?

Hello, I was wondering if I could use the function uigetfile to get the complete file path string.

 Accepted Answer

The documentation for uigetfile() is remiss in not showing any examples that use fullfile() to construct the full file name of the chosen file. Here is how you do it:
[baseName, folder] = uigetfile();
fullFileName = fullfile(folder, baseName)

1 Comment

Thank you! I was looking for the full file path and this is it!

Sign in to comment.

More Answers (1)

The 2nd output argument of uigetfile() gives the path info. See
>>doc uigetfile

1 Comment

Exactly. Reading the help and doc text is a good strategy, when you have questions conderning a command.

Sign in to comment.

Categories

Find more on App Building in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!