How to connect points to create a figure?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Chris Lambrecht
el 9 de Nov. de 2015
Respondida: Star Strider
el 9 de Nov. de 2015
I am given a figure that has points of (0,0), (0,3), and (0,4) and when connecting those points the resulting figure should be a right triangle, however, I am using scatter and lines and am only getting only two lines and an open bottom. What would be the easiest way to plot this so that the figure can be closed and I get that right triangle from the plot.
0 comentarios
Respuesta aceptada
Star Strider
el 9 de Nov. de 2015
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])
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!