filling in between two curves with different x values
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello.
I have a plot
plot(x,y,'r--','LineWidth', 2);
that I want to display with boundaries such that:
plot(x+5,y,'k--','LineWidth', 0.5);
plot(x-5,y,'k--','LineWidth', 0.5);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171183/image.png)
I want to shade the area in between and have tried:
patch([k-5 k+5], [y y], 'g')
but I can't get it to work.
Thanks for any help.
0 commentaires
Réponse acceptée
Guillaume
le 12 Mar 2018
I would think that
patch([x-5, fliplr(x+5)], [y fliplr(y)], 'g')
should work.
8 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!