This package provides a waitbar for use in parfor loops without the need to write to files or any other external synchronization.
Girmi Schouten (2021). waitbarParfor (https://www.mathworks.com/matlabcentral/fileexchange/73670-waitbarparfor), MATLAB Central File Exchange. Retrieved .
To make it more useful I suggest a few small changes I made myself. I added the following code in the update function:
if toc(t_start) - t_last > 1
t_last = t_last + 1;
d = seconds(toc(t_start));
d.Format = "hh:mm:ss";
waitbar(loopCnt/totalLoops, waitbarHandle, compose("t = %s, %s",d,waitbarMessage));
And of course the corresponding start of the timer variable in the initialization:
% Get the time
t_start = tic;
t_last = 0;
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!