How to add progress bar to a code which has different process times according to data

3 次查看(过去 30 天)
Hello all,
I have a code which user uploads bunch of files. Some calculations occur after that. Anyway according to number of uploaded files, the process time changing for each run. I want to add a progress bar which calculates the process time of code and give the progression percentage with regards to the process time.
For example, let's say process time is 30 seconds for 15 files and 56 second for 24 files.
I hope I asked my question clear.
Thanks in advance.

回答(1 个)

Cris LaPierre
Cris LaPierre 2021-1-1
Use a waitbar. You would update the progress at certain stages along the way, allowing the progress to accurately reflect the processing of the data.
One thing to be aware of is this will impact the speed at which your code runs, so you'll want to balance the number of times you update the waitbar with the speed at which your code processes the data.

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by