Error using surf - Z must be a matrix, not a scalar or vector.
2 views (last 30 days)
Show older comments
Rabbia Sajjad
on 8 Dec 2018
Answered: Cris LaPierre
on 8 Dec 2018
Hello, I am using matlab for optimization problem. I have to find the calculated values for maximum volume, radius and height and plot 3D surface between them
radius = sqrt(given_amount/2*3*3.14);
height = ((given_amount)/2*3.14*radius) - radius;
maximum_volume = (length*width*radius)/2 - 3.14*radius*radius*radius;
surf(radius,height,maximum_volume);
It says that z must be a vector.
0 Comments
Accepted Answer
More Answers (0)
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!