Can I speed up this iterative ploting?

3 Ansichten (letzte 30 Tage)
Sinwoo Jeong
Sinwoo Jeong am 22 Okt. 2018
Kommentiert: Sinwoo Jeong am 22 Okt. 2018
Hello.
I need to plot a graph iteratively. (about 10000 times)
One plot consists of a number of sub-plotting as follows.
figure(1)
hold on
u_deformed = rand(54, 24);
w_deformed = rand(54, 24);
for i = 1:size(u_deformed, 1)
plot(u_deformed(i, :), w_deformed(i, :),'b','linewidth', 8)
end
Here, the size of the matrix [u_deformed] and [w_deformed] are 54X24, respectively.
This plot is for drawing a deformed shape of a structure at a certain time step. For each time step, the matrix [u_deformed] and [w_deformed] are changed.
It takes about 0.04 sec for one set of plotting. But, the problem is I need to do it for about 10000 times.
It means it would take 0.04*10000 sec. This is quite problematic for me.
I tried to use parfor for this plotting. But it made the speed even slower.
I want to know whether there is a way for plotting whole this data without for-loop statement.
  2 Kommentare
madhan ravi
madhan ravi am 22 Okt. 2018
What is wrong when you reduce the iteration?
KSSV
KSSV am 22 Okt. 2018
Why you are going for plot when you have a matrix? YOu should use surf eh.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KSSV
KSSV am 22 Okt. 2018
You should try using set. Check the below pseudo code:
h = plot(rand(10,1)) ;
for i = 1:10
set(h,'YData',rand(10,1))
pause(0.1)
end
  1 Kommentar
Sinwoo Jeong
Sinwoo Jeong am 22 Okt. 2018
Thank you. 'set' is much faster than re-plot.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Performance finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by