How can I generate a plane surface in MATLAB?
Show older comments
How can I generate a plane surface in MATLAB?
Accepted Answer
More Answers (1)
xingxingcui
on 29 Mar 2025
1 vote
2 Comments
John D'Errico
on 29 Apr 2025
I never noticed this function appear. It was probably my feature request that caused it to happen, as a few years back, I asked for exactly this capability in MATLAB. I really should check the release notes more often.
Thank you for promoting this function. It operates similarly to xline and yline, but for 3D.
[X, Y] = meshgrid(-1:0.05:1);
Z = exp(- 5*(X.^2 + Y.^2));
mesh(X,Y,Z)
xlabel('x'), ylabel('y'), zlabel('z')
zlim([0, 1.5])
cp = constantplane("x", 0, FaceAlpha=0.5);
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!