RosettaCodeData/Task/Sort-an-integer-array/MATLAB/sort-an-integer-array.m
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

2 lines
138 B
Matlab

a = [4,3,7,-2,9,1]; b = sort(a) % b contains elements of a in ascending order
[b,idx] = sort(a) % b contains a(idx)