# MATLAB: How to arrange indices of matrix A by descending order

sort

if I have
A=[25,41,38] when I sort this matrix by descending order , I will get A=[41,38,21]
I want to arrange indices of matrix A by descending order and shows a result (B) like this
B=[2,3,1]
How to create program to get this result ?
A=[25,41,38];[A_sorted,B] = sort(A, 'descend')A_sorted =    41    38    25B =     2     3     1