MATLAB: Trying to plot function in 3D and keep getting warning

3dfunctiongraphicsMATLABmeshgridsurf

Trying to plot the function = xy(x^2-y^2)/(x^2+y^2), and keep getting Warning: Matrix is singular to working precision. The figure that comes up is empty.
[x,y] = meshgrid(-10:.5:10,-10:.5:10);
z = x.*y.*((x.^2-y.^2)/(x.^2+y.^2));
surf(x,y,z)

Best Answer

Change the / to ./
Related Question