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

 Accepted 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.

2 Comments

Thank you very much! perfect!
My pleasure!
If my Answer helped you solve your problem, please Accept it!

Sign in to comment.

More Answers (0)

Asked:

M-N
on 29 Jan 2019

Commented:

on 29 Jan 2019

Community Treasure Hunt

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

Start Hunting!