UI get file or dirrectory
조회 수: 11 (최근 30일)
이전 댓글 표시
Is there a command similar to, or a way to utilize either uigetfile, or uigetdir that allows a user to select either a file OR a directory and not just one or the other?
e.g. i have a function which will parse/import an entier directory, or individually specified files and i would like a UI window which allows the user to select individual files to be imported or a directory to be imported.
댓글 수: 0
답변 (1개)
Azzi Abdelmalek
2012년 11월 12일
편집: Azzi Abdelmalek
2012년 11월 12일
[file,folder]=uigetfile
if you want to have a file name with its path
fic=fullfile(folder,file)
댓글 수: 2
Azzi Abdelmalek
2012년 11월 12일
The use uigetdir. If you want him to choose add a code like this
str ={'select file','select folder'}
s = listdlg('PromptString','Select a file:','SelectionMode','single','ListString',str)
if s==1
[file,folder]=uigetfile
else
folder=uigetdir
end
참고 항목
카테고리
Help Center 및 File Exchange에서 Dialog Boxes에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!