scobi 0 Newbie Poster

I attached JPG file.I want to make this but tried many times.I am new in matlab help me as soon as possible.

x1=input('\n Please enter the first x-coordinate of the triangle : ');
y1=input('\n Please enter the first y-coordinate of the triangle : ');
x2=input('\n Please enter the second x-coordinate of the triangle : ');
y2=input('\n Please enter the second y-coordinate of the triangle : ');
x3=input('\n Please enter the third x-coordinate of the triangle : ');
y3=input('\n Please enter the third y-coordinate of the triangle : ');
P1=[x1 y1];
P2=[x2 y2];
P3=[x3 y3];
% Print the 3 x-y coordinates of the designated triangle
fprintf('\n\n\n The coordinate of triangle :')
fprintf('\n P1=(%d,%d)',P1)
fprintf('\n P2=(%d,%d)',P2)
fprintf('\n P3=(%d,%d)',P3)
% Plotting the triangle on the x-y axis
plot( [x1 x2 x3 x1], [y1 y2 y3 y1],'r')
xlabel('x')
ylabel('y')
title('Triangle')
fill([x1 x2 x3 x1], [y1 y2 y3 y1],'k')
xlabel('x'); x4=input('\n Please enter the first x-coordinate of the triangle : ');
y4=input('\n Please enter the first y-coordinate of the triangle : ');
x5=input('\n Please enter the second x-coordinate of the triangle : ');
y5=input('\n Please enter the second y-coordinate of the triangle : ');
x6=input('\n Please enter the third x-coordinate of the triangle : ');
y6=input('\n Please enter the third y-coordinate of the triangle : ');
P4=[x4 y4];
P5=[x4 y4];
P6=[x5 y5];
% Print the 3 x-y coordinates of the designated triangle
fprintf('\n\n\n The coordinate of triangle :')
fprintf('\n P4=(%d,%d)',P4)
fprintf('\n P5=(%d,%d)',P5)
fprintf('\n P6=(%d,%d)',P6)
% Plotting the triangle on the x-y axis
plot( [x4 x5 x3 x4], [y4 y5 y6 y4],'r')
xlabel('p')
ylabel('q')
title('Triangle2')
fill([x1 x2 x3 x1], [y1 y2 y3 y1],'c')
xlabel('p')