how to fill between 2 graphs
이전 댓글 표시
Hi eveybody
I could not fill the gap betwween 2 curves. it is shown in below figure.
can anyone help me?
thanks
The code I used is:
plot(KI1,KP1);
xlabel('K_I');
ylabel('K_P');
grid on
hold on
x2=zeros(1,150)
y=linspace(-20,40,numel(x2))
plot(x2,y,'linewidth',2)

댓글 수: 6
darova
2020년 4월 10일
Did you try area? What about intersection fo curves?
halil hasan
2020년 4월 12일
darova
2020년 4월 12일
Maybe i can correct your code? Allow me to help you
halil hasan
2020년 4월 12일
darova
2020년 4월 12일
I have an error here

Do you know why?
halil hasan
2020년 4월 13일
채택된 답변
추가 답변 (1개)
darova
2020년 4월 13일
Here is my shot
y = 0:0.1:pi;
x1 = -sin(y);
x2 = y*0-0.3;
[xc,yc] = polyxpoly(x1,y,x2,y);
xx = [xc(1) x1(x1<x2) xc(end)];
yy = [yc(1) y(x1<x2) yc(end)];
plot(x1,y,x2,y)
patch(xx,yy,'r')
line(xc,yc,'marker','o')
success?

카테고리
도움말 센터 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

