MATLAB: Revolving a 2D profile around the Y axis to create a 3D surface

Viewed 111

I have a function which takes a single variable:

function f = profile_func(x)
    f = -1*(((sin(0.09*pi*x)).^6)./(2.^(2*((x-10)/80).^2)));
return

I can plot it to generate the following 2D profile:

x = linspace(0,100,1000)';
y = feval(profile_func,x);
plot(x,y,'r-','Linewidth',2);

2D profile

Now, I would like revolve this profile to create a 3D surface, around the y axis. I know how to revolve it around the x axis using the cylinder function:

[X,Y,Z] = cylinder(y);
surf(X,Y,Z);

Cylinder

However, this is not what I want it to look like. I want to revolve it around the y axis instead so that it kind of resembles a rippling pond, I guess you could say.

Is there any MATLAB function that is like cylinder, but for the y axis?

0 Answers
Related