How can I display folder contents using uigetfolder?

조회 수: 9 (최근 30일)
Eric Pahlke
Eric Pahlke 2016년 6월 30일
댓글: Eric Pahlke 2016년 7월 1일
I'm using uigetfolder() to navigate towards a folder. However, the interface doesn't display any of the files inside the folder, which means I need to open the path separately outside matlab to make sure I'm selecting the correct folder.
Is there any way to configure uigetfolder() to show the names of files (presumably greyed out)?
Similarly, using uigetfile() I would like to have it show the names of all files (even if they have a different extension than the one selected), again presumably greyed out.

답변 (1개)

Image Analyst
Image Analyst 2016년 7월 1일
uigetdir() doesn't show the files because it doesn't want the user thinking that a specific file needs to be picked. You could use uigetfile() and then require the user to pick a file, then use fileparts() to get the folder and just ignore the returned filename.
I do agree that having files listed in uigetdir() would be useful, but they should be grayed out or disabled, but it would be helpful for the user to tell if they're in the correct folder if they can see the filenames in that folder.
  댓글 수: 1
Eric Pahlke
Eric Pahlke 2016년 7월 1일
Using uigetfile is a little hack-ish but it will work.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by