waitforbuttonpress not working after print call
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre 기본 설정 en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!