35 views (last 30 days)

Show older comments

[theta,phi] = meshgrid(linspace(-pi,pi,41),linspace(-pi/2,pi/2,41));

R = sin(theta)*cos(phi);

[X,Y,Z] = sph2cart(theta,phi,R);

surf(X,Y,Z)

alpha 0.5

axis vis3d

Tried using the code above but it is not giving me what I would expect (a p orbital looking shape). Any way anyone could help me figure this out?

Unai San Miguel
on 21 Feb 2018

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

Start Hunting!