MATLAB: How to draw equipotential surface

surface plot

For example, we have a function
f(x,y,z) = (x * y) * exp(-r)/r
with r = sqrt(x^2+y^2+z^2).
Then I want to draw the equipotential surface of this function,
the surface that satisfies f(x,y,z) = 1 or f(x,y,z) = 0.5… and something else.
How can I do it?

Best Answer

This post I wrote for the MATLAB Graphics blog explains the basic idea behind drawing implicit surfaces like this.
Related Question