Consider a function ? = 2?exp((?^2+?^2)) with x and y on [-2, 2]. Create a line plot in 3-d using plot3(X,Y,Z).
Here is my code so far, please recommend how I fix this:
z=[-2:0.01:2];
x=-2:0.1:2;
y=-2:0.1:2;
[X Y]=meshgrid(x,y);
Z = 2.*X.*exp(-(X.^2+Y.^2))
plot3(X,Y,Z);
grid on
Is grid on or grid off required to make a this work? Why do we use it? Is it optional?
Best Answer