How can the points of a scatter plot placed on a new matrix?

조회 수: 4 (최근 30일)
stelios loizidis
stelios loizidis 2022년 1월 14일
댓글: Jon 2022년 1월 14일
Hello,
I have the following. I have a matrix W (2Χ50) and I make the scatter plot for each of its row, that is,
scatter(W(1,:),W(2,:))
The first point in the sctter plot corresponds to W (1,33), the second to the point W (2,5) and so on. How can I put these points (of the scatter plot) in a new matrix in the order they appear in the scatter plot?

채택된 답변

Jon
Jon 2022년 1월 14일
편집: Jon 2022년 1월 14일
Assuming you mean by the first point, second point, etc in the scatter plot their order of appearance from left to right (along the x axis of the plot) you could do this
[~,idx] = sort(W(1,:))
Wnew = W(:,idx)
  댓글 수: 2
stelios loizidis
stelios loizidis 2022년 1월 14일
It works!!! Thanks for the quick and valuable help !!!!
Jon
Jon 2022년 1월 14일
You're welcome. Good luck with your project.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by