How do I plot a 3D surface bounded over the first octant?
Show older comments
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)
Accepted Answer
More Answers (0)
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!