【发布时间】:2011-08-22 18:05:20
【问题描述】:
为什么我不能在同一个窗口中的每次迭代中绘制数据?我尝试使用drawnow,但它不起作用。代码:
t=0;
T=10;
i =1;
while t<T
. . .
time(i)=(i-1)*delta_t;
scrsz = get(0,'ScreenSize');
figure('position',[80 60 scrsz(3)-110 scrsz(4)-150]);
subplot(1,3,1);
plot(time(i),configurations(1,1,i),'-b','LineWidth',2), hold on;
drawnow;
xlabel('Time[s]');
ylabel('X [m]');
subplot(1,3,2);
plot(time(i),configurations(3,1,i),'-b','LineWidth',2), hold on;
drawnow;
xlabel('Time[s]');
ylabel('Z [m]');
subplot(1,3,3);
plot(time(i),configurations(2,2,i),'-b','LineWidth',2), hold on;
drawnow;
xlabel('Time[s]');
ylabel('\phi [deg]');
t=t+1;
i=i+1;
end
【问题讨论】:
-
请定义“不工作”。
-
每次迭代都会在新窗口中绘制数据。最后我有 10 个绘图窗口。