for m=1:10;
pause(0.2)
h1=figure(1);
set(h1,'Position',[200 200 600 500]);
pause(0.2)
h2=figure(2);
set(h2,'Position',[600 200 600 500]);
end
當我運行上層代碼時,兩個數字像下圖一樣交替彈出。如何阻止matlab圖彈出
我想停止這種彈出屬性並保持整個迭代像下面過程中的位置。
我怎麼能更改這個屬性?
預先感謝您。
我添加了一個代碼。在這段代碼中,兩個數字不斷閃爍。 我想要做的就是停止閃爍。
clear all
close all
clc
%%patch1%%
x1=[-2 0 0 -2];
y1=[-1 -1 1 1];
z1=[0 0 0 0];
a=patch(x1,y1,z1,'green');
c=patch(x1,y1,z1,'green');
%%patch2%%
x2=[0 2 2 0];
y2=[-1 -1 1 1];
z2=[0 0 0 0];
b=patch(x2,y2,z2,'red');
d=patch(x2,y2,z2,'red');
%h1=figure(1),grid on
for k=0:pi/10:10*pi
delete([a b])
figure(1),grid on
a=patch(x1,y1,z1+[-0.1*sin(k) 0.3*sin(k) 0.3*sin(k) -0.1*sin(k)],'green');
b=patch(x2,y2,z2+[0.3*sin(k) -0.1*sin(k) -0.1*sin(k) 0.3*sin(k)],'red');
axis([-2.5 2.5 -1.5 1.5 -0.5 0.5])
pause(0.05)
delete([c d])
figure(2),grid on
c=patch(x1,y1,z1+[-0.3*sin(k) 0.05*sin(k) -0.05*sin(k) -0.4*sin(k)],'green');
d=patch(x2,y2,z2+[0.05*sin(k) 0.4*sin(k) 0.3*sin(k) -0.05*sin(k)],'red');
axis([-2.5 2.5 -1.5 1.5 -0.5 0.5])
pause(0.05)
end
你有沒有考慮過使用['subplot'](http://www.mathworks.com/help/matlab/ref/subplot.html?refresh=true)使用1圖窗口和2個圖? – Dan
現在,我正在使用子情節。但是,我想繪製兩個不同數字的移動圖。如果沒有辦法,我會繼續使用副劇場。 – KKS
您可以[控制圖形窗口的位置和大小](http://www.mathworks.com/help/matlab/ref/figure-properties.html#zmw57dd0e229553),使其不重疊... – Dan