One Minute One-liners for the curious: https://www.youtube.com/@1minute1liners
In this YouTube short, I explain how to create several progress indicator functions for Matlab and Octave. We start with a one-liner and improve from there. The one-liner of note is:
progress=@(a,a0,a1) fprintf("% 3d%%\b\b\b\b\b",max(0,min(100,round(100*abs((a-a0)/(a1-a0))))));
Below are the functions discretehist.gp and its test code tdiscretehist.gp, as well at inthist.gp and the test code tinthist.gp