waitforbuttonpress not working after print call
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 기본 설정 dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!