any way of processing callbacks without updating figures?

Is there any way of processing callbacks without updating the figures? I know that drawnow can update the figures without processing callbacks, but is there some way of doing the opposite? In the code I'm writing, the callbacks are important and need to be handled regularly, but updating the figures is lower priority. I also tried pause(0), but I didn't see any difference between that and drawnow.

 Accepted Answer

Callback functions are just functions, there is nothing magical about them: you can call them from other functions, scripts, classes, etc just like you would any other function. So to "regularly" process the functions you can call them in a loop or use a timer or something of that ilk.

Pay careful attention to the required and optional input arguments!

1 Comment

I have a lot of callbacks, but there are only a few that are super time-critical. I guess that will work for me. It would still be easier if MATLAB had a function that did would process callbacks without me having to poll status, put together an event structure, and call my callback functions. But, I suppose that is just wishful thinking.
Thanks!

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Objects in Help Center and File Exchange

Products

Release

R2025b

Community Treasure Hunt

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

Start Hunting!