sorting coordiantes from a file
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
i have a file which i load in matlab
the file has three columns
*xvalues* *y values* *energy values*
4 5 344
5 1 285
0 0 455
0 1 203
the problem is i want to arrange 1st and 2nd columns as coordinates , so that (0,0) is followed by (0,1) and so on with there values ..
how can i sort it to align values such that the above chart is sorted to
0 0 455
0 1 203
4 5 344
5 1 285
0 件のコメント
回答 (3 件)
1 件のコメント
Walter Roberson
2012 年 12 月 12 日
sortrows(a)
Note: in your sample "a" here, your 4th row is [0 0 203] which does not appear in your desired output "b". Your desired output corresponds to your original data matrix.
saad
2012 年 12 月 12 日
3 件のコメント
Walter Roberson
2012 年 12 月 12 日
b = sortrows(a)
Notice that I did not have a ,1 argument.
saad
2012 年 12 月 12 日
Image Analyst
2012 年 12 月 13 日
Then mark this question as "Answered" - OK?
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!