well, it is a simple question i am new in MATLAB. i cannot put my gradient vectors and level curves on same figure, please help me.
here is my code.
f=@(x,y) 16*y.^2 + 9*x.^2;g= gradient(f, [x, y])figure(1)[X, Y] = meshgrid(-1:.1:1,-1:.1:1);z=f(X,Y);contour(X,Y,z,[0:10])G1 = subs(g(1), [x y], {X,Y});G2 = subs(g(2), [x y], {X,Y});quiver(X, Y, G1, G2)
Best Answer