In Matlab R2016a while waiting for a user input or paused I'm unable to interact with figure controls, like zoom. This doesn't happen in older Matlab versions.
This only happens when a figure was created before and also CLOSED. Run the code below using createFig1 = 0;
(no bug) and createFig1 = 1;
(bug).
Bug will NOT happen if:
- Fig1 is not created
- Fig1 is created but not closed
- Pause is removed
Similar problem also reported here and here.
Sample code:
clearvars; close all;
% If fig1 is created here AND closed, zoom control in fig2 becames unresponsible !
createFig1 = 1;
if createFig1
fig1=figure;
title('Press any key or click to continue...');
disp('Press any key or click to continue...');
k = waitforbuttonpress;
close(fig1); clear fig1;
end
%fig2=figure('units','normalized','outerposition',[0 0 1 1]);
fig2=figure;
plot(randn(1000,1));
title('Fig A');
% #### Bug here if fig1 was created and closed !!!! ####
% #### zoom control gets unresponsible !! ####
disp('Zoom in/out and press any key to select points...')
pause;
createFig1 = 0
, I can only do 5-10 interactions with the figure before the figure window hangs. Reading the comments on the links you provide, I get the impression thatpause
now pauses the GUI by design, and being able to do 5-10 interactions is the buggy behavior... – Joub