IMO, surf() is not at all convenient. The code surf(x+3,y-2,z) % sphere centered at (3,-2,0) is counterintuitive ( surf(x-1,y+2,0) matches the math).
In any case, I would recommend using ellipsoid() instead. Since a sphere is just a special case of an ellipsoid, you can easily understand this and you do not need to deal with surf() , see http://www.mathworks.com/help/matlab/ref/ellipsoid.html
A simple example:
r=5; [x,y,z]=ellipsoid(1,2,3,r,r,r,20); surf(x, y, z,'FaceColor','y', 'FaceAlpha', 0.2); axis equal; box on; xlabel('x-axis (m)'); ylabel('y-axis (m)'); zlabel('z-axis (m)');
source share