MATLAB: How to plot a circular surface with z axis to be a cos function

concentric circlescos functionfsurf

I want to plot a circular surface with concentric circles where the peaks of the concentric sircles to be the peaks of cos(2*pi*x) and to calculate the surface area of this plot. I could do only the "top view" of the circles and the "side view" with the con function.
I would like to thank a lot

Best Answer

Here you go!
This code —
a = linspace(0, 9*pi, 150);
[A,R] = meshgrid(a);
Z = cos(A);
[X,Y,Z] = pol2cart(R,A,Z);
figure
surf(X,Y,Z)
grid on
shading interp
axis equal
colormap(jet)
produces this plot —
I leave the surface area calculation to you. You might find Integration to Find Arc Length (link) helpful.