function Q3 close all %% setup the vectors x=linspace(-5,5,100) y=linspace(-5,5,100) %% compute the function z=y*y - x*x %% plot the surface plot surf(x,y,z) shading flat; alpha(0.5); %%Compute the graident [fx,fy]=gradient(z); %% For every 10th point plot the gradient hold on; x=x(1:10:100) y=y(1:10:100) z=z(1:10:100) fx=fx(1:10:100) fy=fy(1:10:100) quiver3(x,y,z,fx,fy);