fill problem--shading the wrong parts of a curve
Show older comments
I'm having trouble using fill to shade the area between two curves. The code I'm using is
fill(x,[y1 y2],'k')
I've also tried
fill([x x],[y1 y2],'k')
which gives the same result. Is there something obvious I'm missing? Below is the plot I'm getting. I'd like to shade the are between the two curves, not between the first and last y value of each curve. Ideas?

Accepted Answer
More Answers (0)
Categories
Find more on Lengths and Angles 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!