Error using mesh Z must be a matrix, not a scalar or vector. Error in untitled6 (line 5) mesh(W,Y,Z)
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
KSSV
2022-7-26
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)
更多回答(1 个)
Chunru
2022-7-26
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!