MATLAB Answers

preet

how to sort a array with 100 values. and also save there index also?

Asked by preet
on 1 May 2013

i have a problem regarding sorting.... for example

a=[14,3,65,78,98,1];

here

a[1]=14 after sorting its index will be change i.e 3 but i want to save the

previous index values 1 simultaneously mean original index before sorting?

  3 Comments

Zhang lu
on 1 May 2013

Hi.

[new_a b]=sort(a)

'b' is index before sorting ?

preet
on 1 May 2013

thanx dear.

preet
on 1 May 2013

but i required logic without using directly sort() function

Tags

Products

No products are associated with this question.

0 Answers

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today