How do I plot disorganized data?
1 次查看(过去 30 天)
显示 更早的评论
I am currently attempting to plot column G as a function of column K.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/596475/image.png)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/596480/image.png)
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.
0 个评论
回答(2 个)
Star Strider
2021-4-25
I would first try the sortrows function. If I understand correctly what you want to do, that should work.
0 个评论
Image Analyst
2021-4-25
编辑:Image Analyst
2021-4-25
Or
[sortedG, sortOrder] = sort(columnG);
sortedK = columnK(sortOrder); % Sort column k the same way as column G was sorted.
1 个评论
Hidde Pik
2021-4-26
Dear image analyst,
I see your name pop up a lot here. I could really use your help with image processing.
Kind regards,
Hidde
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!