Matlab is not drawing my 3D function correctly with surf command

I'm trying to create a 3D graph but it is not being drawn correctly. If I use ezsurf it works fine but with the normal surf function it draws something that seems incorrect. Does anyone know what I did wrong? Thanks in advance.
a=74
b=58
c=ceil(a/10)
d=ceil(b/20)
v=-2:0.1:2;
w=-2:0.1:2;
[x,y]= meshgrid(v,w);
z = (c*x.^2)-(d*x.^2*y.^2);
figure(1)
surf(x,y,z);
xlabel('X-as');
ylabel('Y-as');
zlabel('Z-as');

 Respuesta aceptada

z = (c*x.^2)-(d*x.^2.*y.^2);
% ^---- element - wise operation

Más respuestas (0)

Productos

Versión

R2018b

Etiquetas

Preguntada:

el 20 de Mzo. de 2019

Comentada:

el 20 de Mzo. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by