Error Using Surface Plot

9 次查看(过去 30 天)
Franklyn Dunbar
Franklyn Dunbar 2017-5-2
Trying to make a three dimensional plot, with the third array being a function of the first two (long,lat,altitude for example).
To try get the syntax right, I am using a practice script.
Why would using the surf function following meshgrid on three variables not work?
q = [1:.1:15];
w = [1:.1:15];
zz = [1:.1:15];
[Q, W, ZZ] = meshgrid(q,w,zz);
figure(2)
surf(Q,W,ZZ)
colorbar

回答(1 个)

Walter Roberson
Walter Roberson 2017-5-2
Your Q, W, and ZZ variables are going to be 3D because you are using meshgrid() on 3 inputs.
The three inputs to surf() need to be 2D.
surf() cannot be used to create volume plots.

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by