Creating Polar mesh in matlab

I want to plot a surface z = f(x,y) and it is desired to plot it on a circle surface. Is it possible in matlab or can create polar mesh on matlab?

 Respuesta aceptada

David Goodmanson
David Goodmanson el 13 de En. de 2021
Editada: David Goodmanson el 13 de En. de 2021
Hi Reza,
% make a rectangular grid of r and theta,
% then define x and y in the usual way
rr = 0:1:20;
thth = (0:.05:1)*2*pi;
[r th] = meshgrid(rr,thth);
x = r.*cos(th);
y = r.*sin(th);
z = 1 + x.^2 - y.^2;
surf(x,y,z)

1 comentario

Reza Lashani
Reza Lashani el 13 de En. de 2021
Editada: Reza Lashani el 13 de En. de 2021
Thanks david. It helped me so much.

Iniciar sesión para comentar.

Más respuestas (1)

Cris LaPierre
Cris LaPierre el 13 de En. de 2021

0 votos

See this answer on how to do this using a rectangular matrix
See this blog post for how to do this with polar coordinates.

1 comentario

Reza Lashani
Reza Lashani el 13 de En. de 2021
Editada: Reza Lashani el 13 de En. de 2021
Thank you cris. These articles was very useful to me.

Iniciar sesión para comentar.

Categorías

Más información sobre Polar Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 13 de En. de 2021

Editada:

el 13 de En. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by