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

3d plottingexponential

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!

Best Answer

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.