how do I shade area under graph with specific x interval?

조회 수: 13 (최근 30일)
Jong Hyun Lee
Jong Hyun Lee 2020년 12월 29일
답변: Image Analyst 2020년 12월 29일
a=10;
t=0:0.1:200;
c_L=0.2.*(1-exp(1).^(-1/a.*t))
plot(t,c_L)
this is my graph and I just want to shade area between t=60:0.1:200;
what function should I use?

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 12월 29일
Try something like this
a=10;
t=0:0.1:200;
c_L=0.2.*(1-exp(1).^(-1/a.*t));
t_shade = 60:0.1:200;
c_L_shade = 0.2.*(1-exp(1).^(-1/a.*t_shade));
plot(t,c_L)
hold on
patch([t_shade fliplr(t_shade)], [c_L_shade zeros(size(c_L_shade))], ...
'r', ...
'FaceAlpha', 0.2)
  댓글 수: 2
Jong Hyun Lee
Jong Hyun Lee 2020년 12월 29일
Thank you for good answer, may I ask what does "patch" command do?
Ameer Hamza
Ameer Hamza 2020년 12월 29일
It is used to draw a polygon, given the x and y coordinates.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2020년 12월 29일

카테고리

Help CenterFile Exchange에서 Networks에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by