How can I plot a circular surface with z axis to be a cos function?

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

 采纳的回答

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.

2 个评论

My pleasure!
If my Answer helped you solve your problem, please Accept it!

请先登录,再进行评论。

更多回答(0 个)

类别

Community Treasure Hunt

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

Start Hunting!

Translated by