Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting 2D Arrays

Status
Not open for further replies.

Forresterian

Computer
Joined
Feb 3, 2006
Messages
1
Location
GB
I am converting a program that measures distances in 3D shapes into matlab and am having problems with the sort command organising my arrays. I am using 2D arrays, both containing numbers. I would like to organise the columns by the numerical values in the second row. So far when I try the sort command it sorts the row without swapping the columns around. Does anyone know a way round this problem, thanks in advance!
 
Well, then maybe you need to transpose the array first?

TTFN



 
Sounds like a simple problem with a simple answer. However, without some example data, it's hard to give an answer. Post a small array and the desired result and you'll have many takers of this LHF (low-hanging fruit).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top