Get the folder path in GUI

조회 수: 25 (최근 30일)
Bohan Wu
Bohan Wu 2019년 8월 7일
댓글: Walter Roberson 2019년 8월 8일
Hi,
Is there any way allow me to do this:
  1. Cilck the push button, something like the uiputfile poped up
  2. I choose certain random path and click 'OK'
  3. this path will be shown as the static text in my GUI
Thanks!

채택된 답변

awezmm
awezmm 2019년 8월 8일
편집: awezmm 2019년 8월 8일
Running this:
[file,path] = uiputfile;
returns the selected or specified file path to path.
You can get the fullfile path by doing:
fullfilepath = fullfile(path, file)
You can put the variable fullfilepath into a static text box since it is a string.
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 8월 8일
However, we recommend not using path as the name of a variable, as that interferes with using the MATLAB function named path

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by