Dear all,
how to get the index when using sort
in Julia?
In Matlab ,we can get the index easily when using sort
,
>> A = [7, 3, 6, 4];
>> [A, inds] = sort(A)
A =
3 4 6 7
inds =
2 4 3 1
In Julia, how to get the index?
julia> A = [7, 3, 6, 4];
julia> sort!(A)
4-element Vector{Int64}:
3
4
6
7