Matlab command inside a for loop keeps the focus on the figure when it gets refreshed and therefore it is not possible to work on the computer while a long code is running. Is there a remedy for this behavior or an alternative to getframe
command?
EDIT: My problem is that when I include the getframe
statement in the for loop each time the plot gets updated the computer focuses on the figure window and I get distracted; it has nothing to do with capturing something else which is on the screen at the moment. My code snippet for plotting is:
h=imagesc(delta*(1:1:xdim)*1e+6,(delta*(1:1:ydim)*1e+6)',Ez',[-1,1]);
set(h,'AlphaData',2.5*epsilon'/epsilon0);
title(['\fontsize{20}Color-scaled image plot of Ez in ring resonator with PML boundary and at time=',num2str(round(n*deltat*1e+15)),' fs']);
xlabel('x (in um)','FontSize',20);
ylabel('y (in um)','FontSize',20);
set(gca,'FontSize',20);
getframe;