waitforbuttonpress not working after print call
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on 기본 설정 in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!