Draw the surface of a two variables function
When I run the code below I get the figure below.
[X,Y] = meshgrid(-10:1:10);
Z = -X.*exp(-X.*Y) + cos(X);
surf(X,Y,Z,’FaceAlpha’,0.75)
What wrong scaling or errors could be contributing to MATLAB’s failure in accurately rendering the surface of the function defined by the code above? In general, what is the best way to plot a 3d surface which has complicated shape like the one above. I have the same problem with the function f = @(x,y) ln(1+x.^2+y.^2) – (x-1).^2 – y.^2When I run the code below I get the figure below.
[X,Y] = meshgrid(-10:1:10);
Z = -X.*exp(-X.*Y) + cos(X);
surf(X,Y,Z,’FaceAlpha’,0.75)
What wrong scaling or errors could be contributing to MATLAB’s failure in accurately rendering the surface of the function defined by the code above? In general, what is the best way to plot a 3d surface which has complicated shape like the one above. I have the same problem with the function f = @(x,y) ln(1+x.^2+y.^2) – (x-1).^2 – y.^2 When I run the code below I get the figure below.
[X,Y] = meshgrid(-10:1:10);
Z = -X.*exp(-X.*Y) + cos(X);
surf(X,Y,Z,’FaceAlpha’,0.75)
What wrong scaling or errors could be contributing to MATLAB’s failure in accurately rendering the surface of the function defined by the code above? In general, what is the best way to plot a 3d surface which has complicated shape like the one above. I have the same problem with the function f = @(x,y) ln(1+x.^2+y.^2) – (x-1).^2 – y.^2 surf, mesh MATLAB Answers — New Questions