Create vector “s “containing elements of ‘x’ sorted in an ascending order. Clear x from the workspace. From s create back a vector with the same elements and in the same order as in x.
Create vector “s “containing elements of ‘x’ sorted in an ascending order. Clear x from the workspace. From s create back a vector with the same elements and in the same order as in x.
Solution:
x = [1 6 3 7 9]
[D,E]=sort(x,'ascend')
clear x
x(E)=D
Comments
Post a Comment