Data point in plot connecting randomly to each other
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Timothy Lim
am 21 Jan. 2019
Kommentiert: Kevin Phung
am 21 Jan. 2019

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 Kommentare
Akzeptierte Antwort
Kevin Phung
am 21 Jan. 2019
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
