Getting the evaluation progress of the gather command

2 views (last 30 days)

The gather command displays its evaluation progress in the Command Window, but I would like grab that number and display it in a MATLAB App label (requiring it to evaluate in the background, so I would use parfeval). However, I cannot find any way to access the evaluation progress. Is there an undocumented way to access the property? Edit: Here is an example from the Command Window

    Evaluating tall expression using  the local MATLAB session:
    - Pass 1 of 2: 46% complete
    Evaluation 25% complete

The 25% value is what I am trying to get.

  3 Comments
Nathan
Nathan on 28 Nov 2024
Edited: Nathan on 28 Nov 2024

Apologies, I mean the Command Window. I would upload a screenshot of what I mean, but my network restricts me from using forms so I am writing on my phone. Here is a code snippet from the Command Window:

    Evaluating tall expression using  the local MATLAB session:
    - Pass 1 of 2: 46% complete
    Evaluation 25% complete

(I hope that formatted itself properly, I can't see the preview on my phone!)

The 25% value is what I am trying to get.

Walter Roberson
Walter Roberson on 28 Nov 2024
Ah, you are using gather (tall array) instead of gather (Parallel Computing Toolbox)

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 28 Nov 2024
You need to turn diary on, and access the diary file while it is still being written. As you will need code to do that, and the code needs to run at the same time as the gather() command, you will need to ran the gather in a background thread or a parallel process (but doing so is likely to interfer with writing to the diary...)
There is no simple way to handle this task.
  1 Comment
Nathan
Nathan on 2 Dec 2024
Thank you! That is a shame as that won't work once the app is compiled, but I was able to get something close to what I was looking for so I'll accept your answer.

Sign in to comment.

More Answers (0)

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!