can someone please tell me how to colour the mark area A,B,C,D?

조회 수: 1 (최근 30일)
Kaluachchi Gedara Saumya Bandara
답변: DGM 2021년 12월 1일
can someone please tell me how to colour the colour the mark area A,B,C,D?
x1=[0.8043 0];
y1=[0 0.0789];
plot(x1,y1,'k')
hold on
x2=[0.8407 0];
y2=[0 0.0825];
plot(x2,y2,'b')
hold on
x3=[0.8726 0];
y3=[0 0.0890];
plot(x3,y3,'g')
hold on
x4=[0.1 0.2];
y4=[0 0.1];
plot(x4,y4,'r')
xlim([0,0.9])
ylim([0,0.1])
xticks([0 0.9 ])
xticklabels({'0','0.9'})
yticks([0 0.1 ])
yticklabels({'0','0.1'})
xlabel('PVB content in binder')
ylabel('SA content in binder')

답변 (1개)

DGM
DGM 2021년 12월 1일
Something like this:
x1=[0.8043 0];
y1=[0 0.0789];
x2=[0.8407 0];
y2=[0 0.0825];
x3=[0.8726 0];
y3=[0 0.0890];
x4=[0.1 0.2];
y4=[0 0.1];
% find intersections
m1 = (y1(2)-y1(1))/(x1(2)-x1(1));
m2 = (y2(2)-y2(1))/(x2(2)-x2(1));
m4 = (y4(2)-y4(1))/(x4(2)-x4(1));
xint14 = ((m1*x1(1)-m4*x4(1))-(y1(1)-y4(1)))/(m1-m4);
yint14 = m1*(xint14-x1(1))+y1(1);
xint24 = ((m2*x2(1)-m4*x4(1))-(y2(1)-y4(1)))/(m2-m4);
yint24 = m2*(xint24-x2(1))+y2(1);
hp = patch([xint14 xint24 x2(1) x1(1) xint14],[yint14 yint24 y2(1) y1(1) yint14],'k');
hp.FaceAlpha = 0.2;
hold on
plot(x1,y1,'k')
plot(x2,y2,'b')
plot(x3,y3,'g')
plot(x4,y4,'r')
xlim([0,0.9])
ylim([0,0.1])
xticks(xlim)
yticks(ylim)
xlabel('PVB content in binder')
ylabel('SA content in binder')

카테고리

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

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by