How to show an updating image generated by "drawnow" in GUI axes1
Show older comments
Hi All, I would like to show an updating image generated by "drawnow" in GUI axes1. This is my code:
function Start_Callback(hObject, eventdata, handles)
set(handles.Start,'string','Running','enable','off');
QuasiBrownianMotion_Co_TimeControl_forGUI;
axes(handles.axes1);
drawnow;
% Update handles structure
guidata(hObject, handles);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
"QuasiBrownianMotion_Co_TimeControl_forGUI" is a function I used to generate images.
The problem right now is whenever I run GUI and hit start button. Matlab always pop out another new image window to show the images instead of showing within axes1. Could anyone help me out? Thanks a lot! Wenlong
7 Comments
Geoff Hayes
on 29 May 2014
Does the function QuasiBrownianMotion_Co_TimeControl_forGUI have the command to draw/display an image? If so, what is that command and how often does it update the image?
You may need to just put the axes(handles.axes1) statement before the call to QuasiBrownianMotion_Co_TimeControl_forGUI in order to get the axes1 updated with the image.
It seems like you will be periodically updating your image via a single call to the brownian motion function. Is that the case?
Geoff Hayes
on 29 May 2014
What is state.p{k}, a handle to something? Is it this set statement this causing the drawing (or re-drawing)?
Wenlong
on 29 May 2014
Wenlong
on 29 May 2014
Geoff Hayes
on 29 May 2014
Edited: Geoff Hayes
on 29 May 2014
Hi Wenlong - You can attach your *.m and *.fig files to any comment you add to your question. Just use the paperclip button to do so.
Wenlong
on 30 May 2014
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!