Get the folder path in GUI

19 次查看(过去 30 天)
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