Data point in plot connecting randomly to each other
조회 수: 6 (최근 30일)
이전 댓글 표시

The pattern of the plot is obviously going up from 0-2 then all the way down, I do not know why are the points randomly connecting to a point further away and not connecting like it used to (by ascending order).
댓글 수: 4
채택된 답변
Kevin Phung
2019년 1월 21일
I would sort the x values and sort the y values based on how the x values were sorted.
You can do this with
[sorted_array sorted_order] = sort(x);
y = y(sorted_order;)
댓글 수: 3
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
