how to plot connected points ?
显示 更早的评论
How do i plot(x,y) such that the points are connected to each other instead of from the origin ?

采纳的回答
更多回答(1 个)
Image Analyst
2017-3-3
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;
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!