Error using mesh Z must be a matrix, not a scalar or vector. Error in untitled6 (line 5) mesh(W,Y,Z)
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Tadiwa
el 26 de Jul. de 2022
Comentada: Tadiwa
el 26 de Jul. de 2022
Hi, I am trying to commute this 3D plot, however I am receiving an error.
w = 200:50:450;
y=180;
[W,Y] = meshgrid(w,y);
Z= 64.0189+1.4629*W-2.626*Y-0.0012*W.^2+0.0098*W.*Y+0.0082*Y.^2
mesh(W,Y,Z)
Error using mesh
Z must be a matrix, not a scalar or vector.
Error in untitled6 (line 5)
mesh(W,Y,Z)
0 comentarios
Respuesta aceptada
KSSV
el 26 de Jul. de 2022
As you have given single value of Z, it would be a line.
w = 200:50:450;
y=repmat(180,1,length(w));
[W,Y] = meshgrid(w,y);
Z= 64.0189+1.4629*W-2.626*Y-0.0012*W.^2+0.0098*W.*Y+0.0082*Y.^2
mesh(W,Y,Z)
Más respuestas (1)
Chunru
el 26 de Jul. de 2022
w = 200:50:450;
y=120:30:240;
[W,Y] = meshgrid(w,y);
Z= 64.0189+1.4629*W-2.626*Y-0.0012*W.^2+0.0098*W.*Y+0.0082*Y.^2;
whos
mesh(W,Y,Z)
0 comentarios
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!