Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
Kaluachchi Gedara Saumya Bandara
Réponse apportée : DGM le 1 Déc 2021
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')

Réponses (1)

DGM
DGM le 1 Déc 2021
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')

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by