> 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/msgbox.md).

# msgbox

Creates a message dialog box.

## 📝 Syntax

* h = msgbox(message)
* h = msgbox(message, mode)
* h = msgbox(message, title)
* h = msgbox(message, title, mode)
* h = msgbox(message, title, icon)
* h = msgbox(message, title, icon, mode)

## 📥 Input argument

* message - a string or a cell of string: the message to display.
* title - a string: the title of the dialog box.
* icon - a string: 'none', 'error', 'help', 'warn' or 'question'.
* mode - a string: 'modal', 'on' or 'nonmodal'.

## 📤 Output argument

* h - a QObject handle.

## 📄 Description

msgbox creates an message dialog box.

h = msgbox(message, title, 'on') specifies whether to replace an existing dialog box having the same name.

## 💡 Examples

```matlab
h = msgbox('help string')
```

```matlab
h = msgbox('help string', 'dialog title')
```

```matlab
h = msgbox('help string', 'dialog title')
h = msgbox('help string', 'dialog title', 'on')
```

## 🔗 See also

[helpdlg](/nelson/markdown/en/gui/helpdlg.md), [errordlg](/nelson/markdown/en/gui/errordlg.md), [questdlg](/nelson/markdown/en/gui/questdlg.md), [warndlg](/nelson/markdown/en/gui/warndlg.md).

## 🕔 History

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