if true % code
enddisp('Question #1');x = 5:0.1:5;y = 5:0.1:5;[X,Y] = meshgrid(x,y);R = sqrt(X.^2 + Y.^2);z = (-1*cos(2*R))./(exp(0.2*R));mesh(X,Y,z)xlabel('x')ylabel('y')zlabel('z')title('Mesh Plot')grid on
MATLAB: I keep getting the error “Error using mesh (line 75) Z must be a matrix, not a scalar or vector.”
error using mesh (line 75) z must be a matrixnot a scalar or vector.
Related Question
- Plot two surfaces each with different color
- “Z must be a matrix, not a scalar or vector.” PLEASE HELP!
- “Contour not rendered for non-finite ZData” warning, working fine on Mathematica
- I am trying to create a surface plot with nested loops and am getting the error “Z must be a matrix, not a scalar or vector.”
Best Answer