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!