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

조회 수: 14 (최근 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 CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by