Monitoring the progress of a long-running parfor loop is not straightforward because the workers cannot communicate. This function gets around that limitation by storing the progress in a text file.
N = 100;
parfor_progress(N); % Initialize
pause(rand); % Replace with real code
parfor_progress; % Count
parfor_progress(0); % Clean up
Jeremy (2022). Progress monitor (progress bar) that works with parfor (https://www.mathworks.com/matlabcentral/fileexchange/32101-progress-monitor-progress-bar-that-works-with-parfor), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!