Additive Dynamic Plotting

5 ビュー (過去 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 Center および File ExchangeGraphics Performance についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by