How to plot a shaded range between a min and max y value for the same x value
Afficher commentaires plus anciens
How do I plot to create an image this this. For each x value I have minimum and maximum values. As shown in the image in the link below:
Thank you very much
Réponses (1)
Mischa Kim
le 24 Fév 2015
Oliver, something like this?
t = 0:0.1:10;
y1 = sin(t);
y2 = sin(t + 0.1) + 0.5;
y3 = cos(t).^2;
y4 = cos(t + 0.2).^2 - 0.2;
figure
hold on
fill([t fliplr(t)],[y2 fliplr(y1)] ,'r')
fill([t fliplr(t)],[y4 fliplr(y3)] ,'b')
grid
alpha(0.15)
Catégories
En savoir plus sur App Building dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!