MATLAB: How to plot “f(x,y) = e^-(x^2+y^2)” function in matlab MATLABmatlab function Undefined function or variable 'y'. Error in Untitled (line 5) y = exp(x.^2+y.^2); my computer gives these errors and I do not know how to fix them. Best Answer Try this: figurefsurf(@(x,y)exp(-(x.^2+y.^2)), [-2 2 -2 2]) Related SolutionsMATLAB: How to plot “f(x,y) = x^2 * y” function in matlab Try this:x = linspace(-2.0, 2.0, 50);y = linspace(-2.0, 2.0, 50);[xm, ym] = meshgrid(x, y);fxy = xm.^2 .* ym;surf(fxy);% Enlarge figure to full screen.set(gcf, 'units','normalized','outerposition',[0 0 1 1]);It gives you almost exactly what you want. You just have to rotate the viewpoint of the axis. I trust you can do this. MATLAB: Different result by hand-differentiaion vs MATLAB diff() function. Your "hand-differentiation" is not correct! The 'diff' answer is correct but can be simplified to an equivalent -2/(y+1)^3. (Perhaps the latter is what you meant to write?) Related QuestionHow to plot “f(x,y) = x^2 * y^3” and its partial derivative function in matlabHow can i draw graph of z^2=x^2-y^2 on matlabPlane y=xHow to replace variables
Best Answer