Get the folder path in GUI

22 Ansichten (letzte 30 Tage)
Bohan Wu
Bohan Wu am 7 Aug. 2019
Kommentiert: Walter Roberson am 8 Aug. 2019
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!

Akzeptierte Antwort

awezmm
awezmm am 8 Aug. 2019
Bearbeitet: awezmm am 8 Aug. 2019
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 Kommentar
Walter Roberson
Walter Roberson am 8 Aug. 2019
However, we recommend not using path as the name of a variable, as that interferes with using the MATLAB function named path

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by