I have a GUIDE GUI (lets call it "Main GUI"), that is having a while loop and this while loop calls the plot every time.
Now I am calling an external GUI from this Main GUI
I know that by setting the windowstyle to "modal" will make the the external GUI to stay on top always even though the while loop is calling the plot function(even though plot is treated as a seperate figure).
Please refer this question Which has the problem code
The problem here is,
while (i < 1000)
yf = rand(1);
y = [y, yf];
iif = [i,iif];
i = i + 1;
plot(iif,y);
%Calling external GUI
if (get(handles.pushbutton, 'Value') == 1)
external_gui;
end
pause(0.001);
end
while the "while loop" is running, if I have a plot and an external function inside the same while loop, the plot figure is refreshed every-time and so the external gui(considering the user has pressed the pushbutton).
This repeated refreshing of two figures makes the adverse effect.
How to make the plot figure as a background figure, which should not bother the external figure ? [Meaning, the plot should go on plotting in the background so, if the user has enabled the external GUI - this external GUI figure should be left alone so there is no repeated refreshing of figure will take place]
I hope I made the point clear, please let me know if you need more explanation. Thanks.
Edit: (As per the suggestion)
h = plot(iif,y);
while (i < 1000)
yf = rand(1);
y = [y, yf];
iif = [i,iif];
i = i + 1;
set(h,'XData',iif,'YData',y);
%Calling external GUI
if (get(handles.pushbutton, 'Value') == 1)
external_gui;
end
pause(0.001);
end
It is not making any difference.