Matlab R2016a 错误 - 等待用户输入时无法与图形交互

Matlab R2016a bug - unable to interact with figure when waiting for user input

在 Matlab R2016a 中等待用户输入或暂停时,我无法与图形控件交互,例如缩放。这不会发生在旧的 Matlab 版本中。

这只会发生在之前创建了一个图形并且也已关闭的情况下。 运行 下面的代码使用 createFig1 = 0;(无错误)和 createFig1 = 1;(错误)。

错误不会发生如果:

也报告了类似的问题here and here

示例代码:

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;

如果您正在寻找解决方法,none。

这是 MATLAB R2016a 中的错误,已在 MATLAB R2016b 中修复。

不幸的是,如果这对您来说是个严重问题,我建议您降级或升级您的 MATLAB,应该没问题。