Borrar filtros
Borrar filtros

Additive Dynamic Plotting

2 visualizaciones (últimos 30 días)
Chris Berry
Chris Berry el 26 de Abr. de 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

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics Performance en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by