Filter löschen
Filter löschen

Additive Dynamic Plotting

5 Ansichten (letzte 30 Tage)
Chris Berry
Chris Berry am 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

Akzeptierte Antwort

Teja Muppirala
Teja Muppirala am 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 Kommentar
Chris Berry
Chris Berry am 26 Apr. 2011
Absolutely! Thank you for your quick and helpful response. It is people like you that make this public forum great!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

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

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by