I just got a straight line with the values you posted. The trick to closing the triangle is to repeat the first set of points (here (0,0)) at the end of the x and y vectors:
x = [0 0 4 0];
y = [0 3 3 0];
figure(1)
plot(x, y)
axis([-1 5 -1 5])
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!