How do I plot disorganized data?

2 vues (au cours des 30 derniers jours)
Jordan Rosales
Jordan Rosales le 25 Avr 2021
Commenté : Hidde Pik le 26 Avr 2021
I am currently attempting to plot column G as a function of column K.
I have tha data loaded into seperate vectors in MATLAB currently, however upon simply plotting these vectors against one another, that all the data needs to be reordered.
I know that the function to reorder the column K data in ascending order is sort(), however I cannot figure out how to reorganize the corresponding values in the column G data, so that the data can accuratedly be plotted.

Réponses (2)

Star Strider
Star Strider le 25 Avr 2021
I would first try the sortrows function. If I understand correctly what you want to do, that should work.

Image Analyst
Image Analyst le 25 Avr 2021
Modifié(e) : Image Analyst le 25 Avr 2021
Or
[sortedG, sortOrder] = sort(columnG);
sortedK = columnK(sortOrder); % Sort column k the same way as column G was sorted.
  1 commentaire
Hidde Pik
Hidde Pik le 26 Avr 2021
Dear image analyst,
I see your name pop up a lot here. I could really use your help with image processing.
Kind regards,
Hidde

Connectez-vous pour commenter.

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by