> For the complete documentation index, see [llms.txt](https://nelson-9.gitbook.io/nelson/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nelson-9.gitbook.io/nelson/markdown/en/gui/uigetdir.md).

# uigetdir

Opens dialog box to select a directory.

## 📝 Syntax

* dir\_ans = uigetdir()
* dir\_ans = uigetdir(path)
* dir\_ans = uigetdir(path, title)

## 📥 Input argument

* path - a string: initial path
* title - a string: title of the dialog box

## 📤 Output argument

* dir\_ans - a string (returned path) or 0 if dialogbox is canceled

## 📄 Description

uigetdir opens a dialog box for selecting a directory.

If path is wrong or not given, the current working directory will be used.

## 💡 Example

```matlab
A = uigetdir();
```

## 🔗 See also

[pwd](/nelson/markdown/en/files_folders_functions/pwd.md).

## 🕔 History

| Version | 📄 Description  |
| ------- | --------------- |
| 1.0.0   | initial version |
