How to "surf" over a circular domain?

조회 수: 10 (최근 30일)
Anthont Goddard
Anthont Goddard 2016년 10월 20일
댓글: Walter Roberson 2020년 2월 15일
I have some code that looks at the behavior for various Bessel functions. I would like to plot this over a sector of angle a, this angle I can change as I wish. I have no idea where to start, everywhere I look it refers me to PDE toolbox.
  댓글 수: 1
KSSV
KSSV 2016년 10월 21일
How the data is? If you have matrices you can always use surf irrespective of the domain .

댓글을 달려면 로그인하십시오.

채택된 답변

Prashant Arora
Prashant Arora 2016년 10월 25일
It is my understanding that you are trying to create a 3-D surf plot of a function, which is calculated over a circular domain, instead of a rectangular domain.
You can use the “meshgrid” function to generate the arguments for the “surf” function. For circular domains, you can pass Radius and polar angle range as arguments to generate the grid. Then, generate the new matrices in Cartesian coordinates using the obtained grid. I am including a small example below, which might help you understand the technique.
%Generate the Polar angle vector containing information about sector location and angle
Theta = [pi/5:0.01:pi/2];
%Generate the Radius vector
R = [0:0.001:1.0];
%Create a grid from angle and Radius
[ThetaG,RG] = meshgrid(Theta,R);
%Create X,Y matrices calculated on grid.
X = RG.*cos(ThetaG);
Y = RG.*sin(ThetaG);
%Calculate the function
Z = X.^2 + Y.^2;
%Surf plot
surf(X,Y,Z);
I hope this helps you in solving the problem.
  댓글 수: 2
Nikolaj Maack Bielefeld
Nikolaj Maack Bielefeld 2020년 2월 15일
편집: Nikolaj Maack Bielefeld 2020년 2월 15일
Thank you Prashant Arora, your comment help me plot this Circular Membrane Wave (Fourier-Bessel Series)
Walter Roberson
Walter Roberson 2020년 2월 15일
Yes, this approach should work well.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by