Progressdisp: A Progress Bar for MATLAB Loops

버전 1.1.0 (3.13 KB) 작성자: Hiroto Imamura
: A class to display the progress of a for-loop in the MATLAB command prompt.
다운로드 수: 44
업데이트 날짜: 2025/2/11

라이선스 보기

Progressdisp is a lightweight and efficient MATLAB class designed to provide real-time progress updates for for-loops directly in the command prompt. It supports two primary display modes:
  • Progress Bar ("bar") – A graphical bar that fills as the loop progresses.
  • Text Counter ("str") – A simple message indicating the current iteration out of the total.
In addition to these features, Progressdisp now includes two methods for displaying custom text messages above the progress display:
  • Disp(input_string): Displays a custom message above the progress output without removing the current progress.
  • Disp_over(input_string): Overwrites any existing top text with a new message, ensuring that only the latest information is shown.
These enhancements provide extra context (such as status updates or error messages) while still keeping track of loop progress in a clean and uncluttered command prompt.
Usage Example:
Displayer = Progressdisp(300, BarOrStr="bar"); % Initialize
for i = 1:300
Displayer.Display_progress(i); % Update progress dynamically
pause(0.01); % Simulate processing
end
Examples using Disp or Disp_over
Displayer = Progressdisp(300, barWidth=40, BarOrStr="bar");
for i = 1:300
Displayer.Display_progress(i);
pause(0.01); % Simulate work
% Display texts above the progress bar (every 20 loops)
if mod(i,20)==0
input_string=append("Custom string at loop: ",num2str(i));
Displayer.Disp_over(input_string)
% optionally
% Displayer.Disp(input_string)
end
end

인용 양식

Hiroto Imamura (2025). Progressdisp (https://www.mathworks.com/matlabcentral/fileexchange/<...>), MATLAB Central File Exchange. Retrieved February 10, 2025.

MATLAB 릴리스 호환 정보
개발 환경: R2022b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
버전 게시됨 릴리스 정보
1.1.0

Included Disp and Disp_over functionality

1.0.1

Minor fixes

1.0.0