path = uigetdir
path = uigetdir(startPath)
path = uigetdir(startPath, title)
| Parameter | Description |
|---|---|
| startPath | Initial directory. If the path is not a directory, the current folder is used. |
| Parameter | Description |
|---|---|
| path | Selected directory, or 0 when canceled. |
uigetdir lets the user choose a directory.
f = dialog('Name', 'Select a folder', 'WindowStyle', 'normal', 'Position', [100 100 420 250]);
uicontrol(f, 'Style', 'edit', 'String', pwd(), 'Position', [28 186 350 24]);
uicontrol(f, 'Style', 'listbox', 'String', {'src', 'temp', 'exports'}, 'Value', 2, 'Position', [28 70 350 105]);
uicontrol(f, 'Style', 'pushbutton', 'String', 'Select', 'Position', [220 28 70 24]);
uicontrol(f, 'Style', 'pushbutton', 'String', 'Cancel', 'Position', [304 28 70 24]);
path = uigetdir(tempdir(), 'Select temporary folder');
if ~isequal(path, 0), disp(path); end
| Version | Description |
|---|---|
| 2.0.0 | Updated dialog API help. |