Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • 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
Feb 3, 2006
1
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!
 
Replies continue below

Recommended for you

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