필터 지우기
필터 지우기

filling in between two curves with different x values

조회 수: 6 (최근 30일)
Jason
Jason 2018년 3월 12일
댓글: Star Strider 2018년 3월 12일
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);
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.

채택된 답변

Guillaume
Guillaume 2018년 3월 12일
I would think that
patch([x-5, fliplr(x+5)], [y fliplr(y)], 'g')
should work.
  댓글 수: 8
Jason
Jason 2018년 3월 12일
Thankyou for reminding me about Mr Hosptial!
Jason
Star Strider
Star Strider 2018년 3월 12일
We’re all in this together!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by