Turn Plot Script into Animated Graph

2 ビュー (過去 30 日間)
Ogen
Ogen 2016 年 3 月 4 日
コメント済み: KSSV 2016 年 3 月 7 日
Hello everyone I have the script for two graph plots but I want them to be animated for better user interaction. Any help to turn the scripts into animated plots would be greatly appreciated. I have attempted to use the "for" function however it was unsuccessful. The scripts can be seen below. Thanks in advance.
if true
% code
[Xc,Yc,Zc] = cylinder(blastradius, 25);
Zc(2, :) = (height-cloudheight + 5);
[Xs,Ys,Zs] = sphere(25);
r = cloudradius;
h = cloudheight;
Xsm = Xs * r;
Ysm = Ys * r;
Zsm = Zs * h + height;
surf( Xsm, Ysm, Zsm)
figure(1)
surf(Xc,Yc,Zc)
hold on
surf(Xsm,Ysm,Zsm)
hold off
grid on
axis equal
view([-45, 15])
xlabel('radius (km)')
ylabel('radius (km)')
zlabel('height (km)')
end
if true
% code
w = linspace(0, 2*pi);
c = [cos(w); sin(w)];
r = [2, 12, 35];
figure(1)
plot(r(1)*c(1,:), r(1)*c(2,:));
hold on
plot(r(2)*c(1,:), r(2)*c(2,:))
plot(r(3)*c(1,:), r(3)*c(2,:))
hold off
axis equal
xlabel('radius');
ylabel('radius');
end

回答 (1 件)

KSSV
KSSV 2016 年 3 月 5 日
  2 件のコメント
Ogen
Ogen 2016 年 3 月 5 日
Thank you Dr. Siva Srinivas Kolukula for pointing me in the right direction. I have seen this link and struggled to implement it into my script to make my plots animated. Do you have an idea of how to go about this, thanks
KSSV
KSSV 2016 年 3 月 7 日
I thought of implementing it in your code straight away..but there are few parameters not given in your code. so I gave the link.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by