필터 지우기
필터 지우기

Additive Dynamic Plotting

조회 수: 2 (최근 30일)
Chris Berry
Chris Berry 2011년 4월 26일
[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

채택된 답변

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by