Data point in plot connecting randomly to each other
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Timothy Lim
el 21 de En. de 2019
Comentada: Kevin Phung
el 21 de En. de 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 comentarios
Respuesta aceptada
Kevin Phung
el 21 de En. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
