% this script generates an error after a mouse click on the figure,
% to show that the figure window is stuck until "enter" is pressed
% at the console.

imagesc(cat(3, 1, 0, 0));
function f(x)
   imagesc(cat(3, 0, 1, 0));
   disp('An error will be now generated. Before pressing enter at the console, check if you see a green square in the figure window. If not, a bug is present');
   a(3) = x;
end

set(gcf, 'WindowButtonUpFcn', @(~,~)f([1 2]));
disp('Please click on the figure: this will generate an error, and the figure will be stuck until you press enter at the console.');
