Azzera filtri
Azzera filtri

Additive Dynamic Plotting

2 visualizzazioni (ultimi 30 giorni)
Chris Berry
Chris Berry il 26 Apr 2011
[EDIT: 20110512 17:01 EDT - reformat - WDR]
Dear fellow MATLAB Users,
I have created a dynamic plotting system, and would like for the resulting plots to build upon one another. My current code places each plot on a predetermined grid space without affecting each other. Here is the code associated with my issue:
______________________
z=zeros(1,3);
xD=[10;30;35];
yD=[10;30;35];
for i=1:3
[x,y] = meshgrid(-10:0.2:50);
z=42 - 4.2*sqrt((x-xD(i)).^2+(y-yD(i)).^2);
z(z<0) = 0;
surf(x,y,z,'linestyle','none');
drawnow;
pause(1);
hold on
end
______________________
I would greatly appreciate any help that could be given to help remedy my issue!
Thanks,
~ Chris

Risposta accettata

Teja Muppirala
Teja Muppirala il 26 Apr 2011
This is an example of where the plots add on top of each other:
xD = 100*randn(1,1000);
yD = 100*randn(1,1000);
[x,y] = meshgrid(-10:0.2:50);
z_sum = 0*x;
h = surf(x,y,z_sum,'linestyle','none');
for i=1:numel(xD);
z=42 - 4.2*sqrt((x-xD(i)).^2+(y-yD(i)).^2);
z(z<0) = 0;
z_sum = z_sum + z;
set(h,'zdata',z_sum);
drawnow;
end
  1 Commento
Chris Berry
Chris Berry il 26 Apr 2011
Absolutely! Thank you for your quick and helpful response. It is people like you that make this public forum great!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Graphics Performance in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by