[flag, h, callbackFcn] = progressbar(v, h, title);
Create and update a progress bar using Matlab's waitbar function. Includes a cancel button. Outputs a function handle that can be used as a callback function.
Parameters |
Description |
v [vector] |
Vector containing the index of the current iteration and the total number of iterations. May contain multiple index/total pairs. Pass as [] to initialize a new progress bar. |
h [handle] |
Wait bar handle to update. Only required if v is not empty. Must be created using Matlab function waitbar. Pass as empty ([]) to specify window title. |
title [string] |
(Optional) Title for progress bar window. Can include '%' to be replaced with the percentage complete based on the input vector. |
Return Values |
Description |
flag [logical] |
Flag indicating whether update of the waitbar was successful |
h [handle] |
Object handle for the waitbar |
callbackFcn [function_handle] |
Function handle for updating the waitbar that can be passed to other functions that allow a callback function input. |
>> [flag, h, callbackFcn] = progressbar([], [], 'Running (%)');
Copyright (c) 2009. All rights reserved.
|
What do you think about this topic? Send feedback!
|