Thread Subject: Function to sort /re arrange rows of matrix

Subject: Function to sort /re arrange rows of matrix

From: Kishore

Date: 11 Nov, 2009 05:10:21

Message: 1 of 2

Hi,

Could anyone kindly let me know which function i may use in order to re arrange the rows of a matrix based on a column of data which has indices.

i.e A is a m x n matrix ie it has m rows.

I have another vector IDx = [ 3 5 10 1 ... m elements] which corresponds to row numbers.

I tried using sort() function and sortrows() .But it did not work.

Thanks,

Subject: Function to sort /re arrange rows of matrix

From: Bruno Luong

Date: 11 Nov, 2009 07:10:05

Message: 2 of 2

Rearrange rows of the array:
A(IDx,:)

Bruno

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
re arrange rows... Kishore 11 Nov, 2009 00:14:03
sort Kishore 11 Nov, 2009 00:14:03
rssFeed for this Thread

Contact us at files@mathworks.com