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.

 Réponse acceptée

Stephen23
Stephen23 le 10 Jan 2026

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 commentaire

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!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks dans Centre d'aide et File Exchange

Produits

Version

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by