Hello, I have a question about my scrollfunction, I asked it here before but couldn't get a good response.
My question is this: I have a scrollfunction that works and works well. I have a gui I made in GUIDE with four axes, and the scrollfunction will change depending on the axes. My problem is this: depending on the rate at which I scroll, the figure can bug out and delete itself. After running some tics and tocs, I found the problem lies with how fast everything gets plotted.
When I scroll slower than it takes MATLAB to plot (~0.1/sec, meaning I can scroll upwards at 10 slices per second). When I scroll at a rate that would replot more than 10 times a second, it bugs out. THe reason I'm asking this, and just assuming its a MATLAB problem, is I have a separate duplicate programmatic GUI that does a identical process, with more or less the same code, that doesn't have this problem. I think the problem is within GUIDE.
Is this common, or is there a workaround? I tried to implement a pause of 0.1 seconds to try to get this bug to not occur, no dice. Regardless of what I do, whenever I try to scroll quickly, I have the figure deletion.
EDIT: Here are some segments of code from my UI. My scrolling function uses the mouse scroll wheel to go upwards and downwards in slices in a 3D matrix axially, sagittally and coronally by clicking on whatever GCA I want to sift through. My data consists of response data which I image in imagesc, and is again constructed in a 3D matrix. It represents a volume I export from a FEA utility.
I have attached the code to this question now as opposed to using gist.
These are the relevant graphics functions I employ at the moment. Besides that, here are some UI screenshots to help you get an idea of what my UI looks like:
And here is the error message I get when I scroll too quickly:
Error using drawnow
Error while evaluating DestroyedObject WindowScrollWheelFcn
Error using matlab.ui.Figure/set
Invalid or deleted object.
Let me know if you'd like me to upload anything else.