MATLAB App Designer: drawnow() is extremely slow
41 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sam Nadjari
el 21 de Nov. de 2019
Comentada: Adam Danz
el 24 de Nov. de 2019
I'm trying to update an image window every few milliseconds in MATLAB's app designer, but the drawnow() function is working very slowly. The same code is working much more quickly outside of the app designer environment. I read this in a separate thread:
Appdesigner (or specifically UIFigure) employs a HTML/Javascript layer which is less efficient than the standard matlab figure.
And I think this may be the root of my problem. Is there a workaround? Any other way to quickly update an image window?
Thanks
0 comentarios
Respuesta aceptada
Adam Danz
el 21 de Nov. de 2019
drawnow() updates all existing graphics. The more graphics that exist, the more updating.
You could try setting the limit rate so that graphics are refreshed less frequently: drawnow limitrate
It's not clear why graphics need to be repeatedly updated but in some contexts, animating your data is a lot faster and cleaner with one of the animation methods such as animatedline.
6 comentarios
Adam Danz
el 24 de Nov. de 2019
Good! If setting the limitrate in drawnow works I wouldn't bother trying the refreshdata method because you'll have to do some restructuring of your code and with frame rates of up to 1000fps, I doubt it would be sufficient.
Más respuestas (0)
Ver también
Categorías
Más información sobre Animation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!