MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

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?

*No products are associated with this question.*

## 3 Comments

## Zhang lu

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/74183#comment_146520

Hi.

'b' is index before sorting ?

## preet

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/74183#comment_146524

thanx dear.

## preet

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/74183#comment_146527

but i required logic without using directly sort() function