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!