Plotting an exponential exp(-x), in 3D?

12 ビュー (過去 30 日間)
Ibrokhimbek Odinaev
Ibrokhimbek Odinaev 2020 年 6 月 14 日
コメント済み: Star Strider 2020 年 6 月 19 日
Hi, I want to plot exp(-x) which is e^-x, and revolve it around x=-5 in order to get a 3D solid that looks like a cooling tower of nuclear power plants. However the limit of y values should be from 1 to 200 which the height of the tower. How can I do that?
Thanks!

採用された回答

Star Strider
Star Strider 2020 年 6 月 14 日
Try this:
r = linspace(0.5, 5, 50);
a = linspace(0, 2*pi, 60);
[R,A] = ndgrid(r,a);
Z = exp(-R);
[X,Y,Z] = pol2cart(A,R,Z);
figure
mesh(X, Y, Z)
grid on
producing:
.Experiment to get it to look the way you want it to look.
  16 件のコメント
Ibrokhimbek Odinaev
Ibrokhimbek Odinaev 2020 年 6 月 19 日
Perfect! Thank you very much!🙌
Star Strider
Star Strider 2020 年 6 月 19 日
As always, my pleasure!

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

その他の回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 6 月 14 日
exp(-x) does not seem to be a good function for this. Try following code
[X, Y] = meshgrid(-1:0.01:1);
XY = sqrt(X.^2 + Y.^2);
Z = 1./XY;
surf(X, Y, Z)
zlim([0 10])
caxis([0 10])
shading interp
  1 件のコメント
Ibrokhimbek Odinaev
Ibrokhimbek Odinaev 2020 年 6 月 14 日
I am doing a project, I have to use exp(-x), plus there shouldn't be th down surface it should be just a solid. Is there any other options?

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

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by