MATLAB: Can anyone please check the codes? the figure doesn’t show up!!!!

isosurface

function plotisosurfaces(d)
a0 = 0.529;
[x, y, z] = meshgrid(-2:.2:2,-2:.2:2,-2:.2:2);
r = sqrt(x.^2+y.^2+z.^2);
a1 = abs(r+0.5*d)./a0;
a2 = abs(r-0.5*d)./a0;
ha = (1/(pi*a0))^(3/2).*exp(-a1);
hb = (1/(pi*a0))^(3/2).*exp(-a2);
psi =(1/(sqrt(2)))* (ha + hb);
psistar =(1/(sqrt(2)))* (hb – ha);
wavefn = psi.*psistar;
isosurface(x,y,z,wavefn,0.3)
daspect([1 1 1]);
view(3);
axis vis3d;
camlight;
lighting phong;
end

Best Answer

Try without an explicit isovalue
isosurface(x,y,z,wavefn)