how to plot connected points ?
Mostrar comentarios más antiguos
How do i plot(x,y) such that the points are connected to each other instead of from the origin ?

Respuesta aceptada
Más respuestas (1)
Image Analyst
el 3 de Mzo. de 2017
If you want them going monotonically from left to right, then you can sort them.
[newX, sortOrder] = sort(x); % Sort x ascending.
newY = y(sortOrder); % Sort y in exactly the same order.
plot(newX, newY, 'b-*');
grid on;
Categorías
Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!