waitforbuttonpress not working after print call
이전 댓글 표시
Hi, weird thing is happening in my code.
for i=1:5
% Some prior codes
print(sprintf('%s/%s', outputdir, filename), '-dpng');
key = waitforbuttonpress;
value = double(get(gcf,'CurrentCharacter'));
end
After drawing some plots on a figure, I save it using print and then confirm the result via wiatforbuttonpress and then move to the next figure. It works as intended only if I remove the print line. Otherwise, it doesn't continue to the next loop. More interesting thing is, if I run the code step by step, there is no problem. It saves the figure and waits for a button press and then continues to the next loop. Did I do something wrong?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 기본 설정에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!