Running GUI shows last images in the axes - how to make the axes be empty
1 次查看(过去 30 天)
显示 更早的评论
I built simple guide that shows image on axes.
When I restart the guide, I see the last image and the pressed pushbuttons (even thouth I exit the guide and re-entered, it looks like it continues from the last run and not reset itself).
I thought it related to global variables but it is not (I eliminated it and still has the same issue).
How to reset the guide?
Thx
0 个评论
回答(1 个)
Image Analyst
2023-7-19
It should not be doing this but you forgot to attach your .fig and .m files. At the beginning of your OpeningFcn function put this:
clear global
cla(handles.axesImage); % or whatever tag you used for your image axes.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
2 个评论
Image Analyst
2023-7-20
Looks like you forgot to attach the fig and m file but that's OK because I'm writing this from a computer that does not have MATLAB on it right now. Try moving cla(handles.org_img)
to the OutputFCN function because maybe the axes does not yet by the time you called in in OpeningFcn. So move it either to the end of OpeningFcn, or to the OutputFcn, or else put drawnow on the line before it in the OpeningFcn. If that doesn't work, make sure the Tag in GUIDE is 100% exactly what you have in your code, down to the capitalization.
I should be back home later tonight and might be able to try your programs then if you attach them.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!