figure;
ax1 = axes;
figure;
ax2 = axes;
x = 0; y = 0;
while ishandle(ax1) && ishandle(ax2)
x = x + 1;
y = y + 1;
figure(1)
scatter(x,y, 'MarkerEdgeColor', 'red')
hold on
figure(2)
scatter(x,y, 'MarkerEdgeColor', 'blue')
hold on
end
Run Code Online (Sandbox Code Playgroud)
在我的脚本中,我有多个数字,这些数字将在循环中更新.脚本运行时必须显示数字.不幸的是,当前更新的数字总是在前景中弹出,这使得无法监视某个数字.我理解调用figure(1)并figure(2)导致这种行为,但我怎么能在不将窗口置于前景的情况下绘制这些数字?