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.

답변 (2개)

Star Strider
Star Strider 2021년 4월 25일

0 개 추천

I would first try the sortrows function. If I understand correctly what you want to do, that should work.
Image Analyst
Image Analyst 2021년 4월 25일
편집: Image Analyst 2021년 4월 25일

0 개 추천

Or
[sortedG, sortOrder] = sort(columnG);
sortedK = columnK(sortOrder); % Sort column k the same way as column G was sorted.

댓글 수: 1

Hidde Pik
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

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 4월 25일

댓글:

2021년 4월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by