When i solve this equation, i get a surface with a slant! I dont know what is the problem, can anyone fix it?
Show older comments
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.
Answers (1)
Grzegorz Knor
on 4 Sep 2011
0 votes
First of all, the radius r in polar coordinates must be non-negative.
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!