Error using surf (line 71) Z must be a matrix, not a scalar or vector.

3 views (last 30 days)
I have a 285x3 array (kerrygold_centre) and I use first and second column for X and Y values, i have a 285x1 array (speed), and when i try to use it as Z value i get the error code.... Error using surf (line 71) Z must be a matrix, not a scalar or vector.
surf(kerrygold_centre(1:285,1),kerrygold_centre(1:285,2),speed(1:285,1));

Accepted Answer

VBBV
VBBV on 27 Apr 2021
speed(1:285,1:285) % this matrix must have 285 x285 elements

More Answers (0)

Community Treasure Hunt

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

Start Hunting!