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

14 visualizaciones (últimos 30 días)
Ibrokhimbek Odinaev
Ibrokhimbek Odinaev el 14 de Jun. de 2020
Comentada: Star Strider el 19 de Jun. de 2020
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!

Respuesta aceptada

Star Strider
Star Strider el 14 de Jun. de 2020
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 comentarios
Ibrokhimbek Odinaev
Ibrokhimbek Odinaev el 19 de Jun. de 2020
Perfect! Thank you very much!🙌
Star Strider
Star Strider el 19 de Jun. de 2020
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (1)

Ameer Hamza
Ameer Hamza el 14 de Jun. de 2020
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 comentario
Ibrokhimbek Odinaev
Ibrokhimbek Odinaev el 14 de Jun. de 2020
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?

Iniciar sesión para comentar.

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by