How do I plot a 3D surface bounded over the first octant?
显示 更早的评论
I'm trying to plot the surface X+Y+Z=a bounded in the first octant, where a is a constant. My code so far is as follows, however, I have no idea how to bound it within the first octant and I always end up with a square, and not the expected result of a triangle.
a=2; [X,Y]=meshgrid(-3:0.5:3,-3:0.5:3); Z=a-X-Y; surf(X,Y,Z)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!