matlab no title
Friday, December 20, 2013
Sort variable
Your data :
a = [10 1 8 3 17 32 35 23 7 4]
b = [22 2 20 9 32 37 46 34 19 13]
You want to :
aSorted = [1 3 4 7 8 10 17 23 32 35]
bSorted = [2 9 13 19 20 22 32 34 37 46]
Hereis:
[
aSorted
,
idx
]
=
sort
(
a
)
bsorted
=
b
(idx
)
Function
for x = 1:10
disp(x)
end
Home
Subscribe to:
Posts (Atom)