フィルターのクリア

Ploting every n-th result in a for loop

2 ビュー (過去 30 日間)
Piotr Haciuk
Piotr Haciuk 2019 年 4 月 5 日
コメント済み: dpb 2019 年 4 月 5 日
Hi guys,
I'm plotting every result calculated using a for loop,
i'm using clf command to keep displaying new plot
the issue I have is 1000 iterations of the loop resulting in few minutes of showing the plots
Is there a way to 'speed-up' displaying it, i.e displaying every 10th plot instead of everyone?
Thank you
P.S. the code structure as follow:
clc; clear all
v=2;L=100;
for t=0:0.01/v:L/v
clf
%here some calculations
o=t*v;
plot(x,wd)
set(gcf,'units','normalized','outerposition',[0 0 1 1])
title(sprintf('time [s]=%4.1f / current position [m]=%4.1f',t,o ));
xlabel('Length of the beam [m]'); ylabel('maximum deflection [m]');
grid on
box on
ylim([-0.05 0.05]);
drawnow;
pause(.1);
end

回答 (1 件)

dpb
dpb 2019 年 4 月 5 日
v=2;L=100;
N=10;
for t=0:0.01*N/v:L/v
clf
...
To introduce a 10-fold reduction...
  2 件のコメント
Piotr Haciuk
Piotr Haciuk 2019 年 4 月 5 日
What if I can't touch the 't' term to match the vector size required for calculations?
Any other way of reduction?
dpb
dpb 2019 年 4 月 5 日
Introduce a loop counting variable and logical test...

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by