How to plot a shaded range between a min and max y value for the same x value
조회 수: 8 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Mischa Kim
2015년 2월 24일
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)
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!