progressbar

Versión 1.0.0.0 (5,45 KB) por Ohad Gal
Progressbar with an abort button.
10,8K descargas
Actualizado 18 jun 2003

Ver licencia

This zip file contain 3 files:
progressbar.m - the progress bar
gui_active.m - polling function to be used in the runnig application (optional)
gauge_abort_icon.mat - the icon on the button (optional button)

Directions:
place 3 files in the same folder, and let MATLAB "know" it's path.
you can create as many progressbars as you want,
and update each of them using a unique handle.

if a progress bar is closed using the "X" button on the upper-right
corner of the progressbar, the function will create it again
with it's same state, see example below (use copy-paste)

% progressbar - shows a progress bar dialog based on the function "waitbar"
%
% Format: handle = progressbar( handle,increment [,string,titlestr] )
%
% Input: handle - handle to current progress bar, [] for a new one
% increment - a fraction (0..1) to increment by.
% (-1) signals the function to remove the handle from
% the persistant list and close the progressbar
% string - a string to be replaced in the progress bar (optional)
% titlestr - a title for the dialog box (optional)
%
% Output: handle - a graphic handle of the dialog box
%
%
% NOTE: this function uses a persistant list of handles and thier values.
% therefore, to delete a progressbar, please call the function with:
% progressbar( handle,-1 );
%
% an "abort" button is formed inside the progressbar, if the calling process
% uses the persistent function "gui_active". when the "abort" button is pressed,
% the Callback function "gui_active" changes it's value to zero, which enables
% the application to interactively stop execution
%
% Example: gui_active(1); % will add an abort button
% h = progressbar( [],0,'my test' );
% max_count = 1e+3;
% for idx = 1:max_count
% fprintf( '%d\n',idx )';
% h = progressbar( h,1/max_count );
% if ~gui_active
% break;
% end
% end
% progressbar( h,-1 );
%

Citar como

Ohad Gal (2024). progressbar (https://www.mathworks.com/matlabcentral/fileexchange/3607-progressbar), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R12.1
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Dialog Boxes en Help Center y MATLAB Answers.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0