フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I have created a video object to plot a graph which progresses with time. I have a large number of plotting data points due to which the graph progresses slowly. How can I reduce this time?

1 回表示 (過去 30 日間)
Siddharth
Siddharth 2013 年 5 月 28 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
video = 0;
if video==1
vidObj = VideoWriter('video.avi','Motion JPEG AVI');
open(vidObj);
end
for i=1:numel(A1)
% figure
bild = figure(1);
subplot(1,2,1);
plot(A1(1:i),A2(1:i),A1(i),A2(i),'*r');
xlabel('displacement [mm]'); ylabel('force [kN]');
axis([min(A1) max(A1) min(A2) max(A2)]);
title(['Time: ' num2str((i-1)/84,'%4.0f') 's']);
grid on;

回答 (1 件)

Iain
Iain 2013 年 5 月 28 日
Instead of calling the figure, the subplot, and then freshly plotting the line and the most recent point, try:
a = plot(A1(1),A2(1),A1(1),A2(1),'*r');
for i = 1:numel(A1)
set(a(1),'XData',A1(1:i),'YData',A2(1:i))
set(a(2),'XData',A1(i) ,'YData',A2(i))
drawnow
end
  1 件のコメント
Siddharth
Siddharth 2013 年 5 月 28 日
Error using handle.handle/set Invalid or deleted object.
Error in mov2 (line 27) set(a(1),'XData',A1(1:i),'YData',A2(1:i))
it gives this error if i incorporate it in my program.

この質問は閉じられています。

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by