How might I use meshgrid and surf to plot a surface of a two-dimensional function handle?
So instead of f(x1,x2), f(x) when x=[x1 x2]
f =@(x1,x2) x1.^2 + x2.^2;t = linspace(-10,10,20);[xx,yy] = meshgrid(t,t);surf(xx,yy,f(xx,yy))
function handlemeshgridsurf
f =@(x1,x2) x1.^2 + x2.^2;t = linspace(-10,10,20);[xx,yy] = meshgrid(t,t);surf(xx,yy,f(xx,yy))
Best Answer