Lagging with updating a Figure
Show older comments
I am having an issue when it comes to a figure I have in a GUI. I have it so that an filled object updates its position and moves around the plot based on the input from an accelerometer that is hooked up to my computer. I have it moving around in the way I want however after not very much time the figure begins to lag more and more. I havent yet found a way to fix this issue. If you have an ideas or ways to fix this your help would be much appreciated.
2 Comments
How are you plotting this? What code are you using? There a many ways to plot data using MATLAB, and there are also many ways to access and change that plotted data, so how do you expect us to know what you are doing if you do not give us any information at all?
There are lots of talented people here who volunteer their time to help others, but they can't read minds and they can't read your computer screen. Please help them by reading this, and following its advice:
In particular you can upload code using the paperclip button, and please explain exactly how you are using/calling your code, and what you expect it to do.
Kevin
on 10 Mar 2015
Accepted Answer
More Answers (1)
Image Analyst
on 12 Mar 2015
0 votes
I think Stephen is probably right. You're using up more and more memory and it slows down. I know that, in older versions of MATLAB, when I would repeatedly call imshow() it would store all those images, just covering up the one before, using up more and more memory until it ground to a halt. I could call cla or cla('reset') before I put stuff into the axes and that seemed to fix it with no slowdown anymore. Try clearing out old clutter from your axes by calling cla and see if that helps.
Categories
Find more on Graphics Performance in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!