waitbar
Creates or updates a wait bar figure.
📝Syntax
h = waitbar(x)
h = waitbar(x, message)
h = waitbar(x, h)
h = waitbar(x, h, message)
📥Input Arguments
Parameter Description
x Progress value. Values below 0 are clipped to 0; values above 1 are clipped to 1.
📤Output Arguments
Parameter Description
h Graphics figure handle. The progress value is stored in UserData.
📄Description

waitbar creates a progress figure or updates an existing one. The handle supports set, get, close, delete, and waitfor.

💡Examples
Create and update a wait bar.
h = waitbar(0.25, 'Starting');
pause(0.1);
h = waitbar(0.75, h, 'Almost done');
Example illustration
Update a wait bar inside a loop.
h = waitbar(0, 'Processing');
for k = 1:3
  h = waitbar(k / 3, h, 'Processing');
end
close(h)
🔗See Also
dialoguiprogressdlg
🕔Version History
Version Description
2.0.0 Updated dialog API help.
Edit this page on GitHub