When i solve this equation, i get a surface with a slant! I dont know what is the problem, can anyone fix it?
Afficher commentaires plus anciens
My program involves bessel functions in polar coordinates (r,theta). The equation to solve is:
z(r,theta)=(Besselj(1,r)+1.90187*r).cos(theta)
I wrote the folowing code:
[th,r] = meshgrid((0:5:360)*pi/180,0:.05:1);
z=(besselj(1,r)+1.90187.*r).*cos(th);
[X,Y,Z] = pol2cart(th,r,z);
surf(X,Y)
- I would like to know whether my program code is correct to sovle the equation and
- When i solve it, i get a plot that is slanted. Is there somethingn wrong with my code?
Thanks, any help will be highly appreciated.
Réponses (1)
Grzegorz Knor
le 4 Sep 2011
0 votes
First of all, the radius r in polar coordinates must be non-negative.
1 commentaire
Nanda
le 4 Sep 2011
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!