Error using mesh Z must be a matrix, not a scalar or vector. Error in untitled6 (line 5) mesh(W,Y,Z)
1 view (last 30 days)
Show older comments
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 Comments
Accepted Answer
KSSV
on 26 Jul 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)
More Answers (1)
Chunru
on 26 Jul 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 Comments
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!