lab5 task1 done, task2 nearly finished

This commit is contained in:
ti_mo
2026-06-22 22:03:28 +02:00
parent 48793b1532
commit eb4d72c7c2
16 changed files with 2727 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
function parfor_waitbar(f, totalJobs, detail, reset)
persistent done
if reset
done = 0;
if ishandle(f)
if isempty(detail)
waitbar(0, f, "Starting");
else
waitbar(0, f, detail);
end
end
return
end
if isempty(done)
done = 0;
end
done = done + 1;
if ishandle(f)
progressText = sprintf("Done %d/%d", done, totalJobs);
if ~isempty(detail)
progressText = sprintf("%s | %s", progressText, char(detail));
end
waitbar(min(done / totalJobs, 1), f, progressText);
end
end